The Actipro
Using the TransitionPresenter Control
The TransitionDataTemplate
or a DataTemplateSelector
to build the user interface for the objects.
Wizard for WPF using the transition presenter with a bar wipe transition to switch between pages
This XAML code shows how to create a Transition
Only one content can be displayed in the transition presenter, although as new content is selected, it is transitioned in based on the transition that is currently assigned to the transition presenter.
This XAML code shows how to assign a specific Transition to the transition presenter via the Transition
That code assigned a Fade
The Delegate
This XAML code shows how to assign a specific Transition to the transition presenter via the Transition
A class called MultiOut
, then it will return an opposite variation of the picked transition (if the transition supports it). This makes it easy to show different directions of transitions for forward and backward progress, such as in Wizard for WPF.
The currently visible content in the transition presenter is set via the TransitionContent
property. When a new object is set to that property, the transition presenter performs a transition from the "from" content (existing property value) to the "to" content (new property value). You can use the ContentTemplate
or ContentTemplateSelector
properties to set a DataTemplate
or a DataTemplateSelector
for the "to" content. Of course, you can bind all this properties in XAML too.
You can specify a default Transition
You can also specify a default Duration
for transitions that support defaultable durations. This is done via the Transition
The TransitionIn
(the default) or Out
transitions.
The Transitionnull
Content
to an object, a transition is enabled. If set to false
, an instant display of the "to" content will occur.
The Transition
The TransitionTransitionPresenter
to be applied and batched into a single update/transition.
Using the ToggleTransitionPresenter Control
Unlike the TransitionPresenter
, which transitions changes to the Content
property, the ToggleContent
and "alternate" content. The alternate content is specified by the Alternatetrue
. In all other respects, the ToggleTransitionPresenter
works identically to the TransitionPresenter
.
Built-In Transitions
The Shared library includes a number of built-in transitions. Many of the built-in transitions support multiple directions and have an in/out mode concept. This table shows the built-in transitions:
Type | Description |
---|---|
A wipe transition between two elements that uses two straight bars with a configurable gradient spread. The transition supports Begin It also has a configurable Spread property that indicates how wide of a gradient to use for the bar. A value of |
|
A wipe transition between two elements that uses a straight bar with a configurable gradient spread. The transition supports Begin It also has a configurable Spread property that indicates how wide of a gradient to use for the bar. A value of |
|
A wipe transition between two elements that uses a box. The transition supports Begin |
|
A crossfade transition between two elements that zooms the new content in as well. The transition supports Begin It also has configurable Zoom |
|
A crossfade transition between two elements. The transition supports Begin It also has a configurable Blur |
|
A wipe transition between two elements that uses four boxes. The transition supports Begin |
|
A slide transition between two elements that moves one element over the other, or alternatively pushes the other. The transition supports Begin It also has a Is |
|
A wipe transition between two elements that uses a wedge shape. The transition supports Begin Although this transition supports a direction, it one works for horizontal or vertical directions. Diagonal directions will be converted to a horizontal direction. |
Creating Custom Transitions
Custom transitions can be created in multiple ways. Any custom transition must inherit the Transition class or one of its subclasses.
When inheriting Transition directly, implement the On
An easier way to create custom transitions is via XAML using the StoryboardStyle
to the "from" and "to" content while a transition is occurring. The two storyboard properties optionally set a Storyboard
to animate properties on the "from" and "to" contents.
This XAML code shows how to create a custom transition based on a Storyboard
Many of our built-in transitions a programmatically created and inherit the StoryboardStoryboard
-based animation but also support the more advanced concepts of multiple directions, modes, etc.
Integrating the WPF Pixel Shader Effects Library
The WPF Pixel Shader Effects Library, announced here (external), includes several transition effects that leverage the UIElement.Effect
property, which is included in .NET 3.5 SP1. These effects are written using Microsoft's High Level Shader Language (HLSL), which provide a lot of control over what is rendered.
The TransitionPreview control using banded swirl and cloud reveal transitions
The transitions in the WPF Pixel Shader Effects Library can be easily integrated into the TransitionEffectTransition
, which can be used in your own applications.
This XAML code shows how to utilize the BandedSwirlTransitionEffect
in a TransitionPresenter
using the EffectTransition
class from the sample application: