Intersoft.Client.UI.Controls Namespace > ContentTransition Class : IsStaticContent Property |
Public Property IsStaticContent As Boolean
Dim instance As ContentTransition Dim value As Boolean instance.IsStaticContent = value value = instance.IsStaticContent
public bool IsStaticContent {get; set;}
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)); }); } |
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