Intersoft ClientUI Documentation
PlayTransition Method



Play the transition using the existing content.
Syntax
Public Sub PlayTransition( _
   ByVal postTransitionAction As Action _
) 
Dim instance As ContentTransition
Dim postTransitionAction As Action
 
instance.PlayTransition(postTransitionAction)
public void PlayTransition( 
   Action postTransitionAction
)
public:
void PlayTransition( 
   Action^ postTransitionAction
) 

Parameters

postTransitionAction
Remarks

ContentTransition is generally a content control which performs transition when its Content property changes. This means that you need to assign a new content for the ContentTransition to run its transition. In certain cases, this may not be ideal when the new content is a complex object that takes time to recreate and render. Doing so may affect the smoothness of the animation while transitioning to the particular complex object.

To address the performance issue in such scenario, you may want to reuse the existing content and perform modification to the existing object, while being able to transition the previous and the next state of the content. This approach is called static content transition mechanism where the transition is performed on an existing content rather than a new content.

To enable the static transition mechanism, you set the IsStaticContent and the UseCachedVisualForTransition property of the control to true. Next, you call the PlayTransition method in the code and then pass-in the delegate to be called when the transition is performing.

The following code shows how to transition a GlassLabel control by animating its original state to a new state where the Background is set to Blue color.

XAML
Copy Code
<Grid x:Name="LayoutRoot">
        <StackPanel VerticalAlignment="Center">
            <Intersoft:ContentTransition x:Name="Transition1" Width="300" Height="100" 
                                         DefaultTransition="FlipUp"
                                         IsStaticContent="True"
                                         UseCachedVisualForTransition="True">
                <Intersoft:GlassLabel x:Name="GlassLabel1" Content="Welcome"/>
            </Intersoft:ContentTransition>
            <Intersoft:UXButton x:Name="ChangeButton" Content="Change Background" Margin="10" HorizontalAlignment="Center"
                            Click="ChangeButton_Click"/>
        </StackPanel>
</Grid>
C#
Copy Code
private void ChangeButton_Click(object sender, RoutedEventArgs e)
        {
            Transition1.PlayTransition(
                () =>
                {
                    GlassLabel1.Background = new SolidColorBrush(Color.FromArgb(255, 35, 57, 102));
                });
        }
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ContentTransition Class
ContentTransition Members

Send Feedback