Intersoft ClientUI Documentation
PlayTransition Method
See Also  Send Feedback
Intersoft.Client.UI.Controls Namespace > ContentTransition Class : PlayTransition Method






postTransitionAction
Play the transition using the existing content.

Syntax

Visual Basic (Declaration) 
Public Sub PlayTransition( _
   ByVal postTransitionAction As Action _
) 
Visual Basic (Usage)Copy Code
Dim instance As ContentTransition
Dim postTransitionAction As Action
 
instance.PlayTransition(postTransitionAction)
C# 
public void PlayTransition( 
   Action postTransitionAction
)
Delphi 
public procedure PlayTransition( 
    postTransitionAction: Action
); 
JScript 
public function PlayTransition( 
   postTransitionAction : Action
);
Managed Extensions for C++ 
public: void PlayTransition( 
   Action* postTransitionAction
) 
C++/CLI 
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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.