The Actipro Blog

All the latest UI control development news from Actipro

WPF products to add support for Microsoft’s Pixel Shader Effects (WPF FX) Library

The next maintenance release of WPF Studio will include some new functionality that allows HLSL-based pixel shader effects to be used with any of our WPF products that use transitions, including Wizard, Docking/MDI, NavigationBar, and more.


The Banded Swirl transition

Shader effects are a new feature in .NET 3.5 SP1 and can help make a lot more complex transitions than what can be created with standard WPF-based transitions. 

Transition Features in the Actipro WPF Shared Library

The Actipro WPF Shared Library, which is included for free with any of our WPF products, includes a number of classes that support animated transitions between two objects. These can be anything from a simple fade to a complex wipe. At the heart of this functionality is the TransitionPresenter control.

The TransitionPresenter is a custom ContentPresenter, which uses a specified transition to animate changes to it's Content, ContentTemplate, or ContentTemplateSelector properties. TransitionPresenter is used in the default control templates for many of our WPF controls in place of ContentPresenter.

The transitions are defined by the Transition class, which the TransitionPresenter calls into and receives events from. There are numerous built-in transitions provided by the Shared Library, and custom transitions can easily be created. But there are some limitations since this utilizes WPF animations and storyboards to achieve it's effects.

WPF Pixel Shader Effects Library

Microsoft released the WPF Pixel Shader Effects Library on CodePlex, which includes a collection of transitions that utilize the Effect property added to the UIElement class in .NET 3.5 SP1. These transitions are written in the High Level Shader Language (HLSL), which can be compiled and loaded into a ShaderEffect object. The ShaderEffect object can then be used to transition from one object to another, using a "progress" property.

There are some pretty slick transitions provided by this Library, but integrating them into our model was not very straight forward. Therefore, we put together the EffectTranstion class which allows transitions from the WPF Pixel Shader Effects Library to be used by the TransitionPresenter (and thus many of our products).


The Cloud Reveal transition

The source code for EffectTransition is included in our sample application, as is a compiled version of the WPF Pixel Shader Effects Library transitions. We've also added two new QuickStarts showing off the transitions in the TransitionPresenter and Wizard controls.

To get started you simply need to include the EffectTransition class in your project and then add a reference to WPF Pixel Shader Effects Library (TransitionEffects.dll). Then following the two new QuickStarts, you would load up the desired transitional effect.


The WPF Pixel Shader Effects Library provides a lot of neat transitions that you can now easily integrate into WPF Studio. Also, you can now build your own transitions using Microsoft's High Level Shader Language, when using WPF animations isn't enough.

Filed under: Actipro, In development, WPF

Pingbacks and trackbacks (1)+

Comments are closed