VisualTransition.GeneratedDuration Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the amount of time it takes to move from one state to another.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)


Public Property GeneratedDuration As Duration
public Duration GeneratedDuration { get; set; }
<object GeneratedDuration="duration"/>

Property Value

Type: System.Windows.Duration
The amount of time it takes to move from one state to another.


You can specify how long a transition takes by setting the GeneratedDuration property. When you set the GeneratedDuration property, you are specifying the amount of time it takes for the transition to occur.


The following example specifies that the control takes one half second to go into the MouseOver state. For the entire example, see Customizing the Appearance of an Existing Control by Using a ControlTemplate.

<!--Take one half second to trasition to the MouseOver state.-->
<VisualTransition To="MouseOver" 
                      GeneratedDuration="0:0:0.5" />

Version Information


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.