Windows Dev Center

VisualTransition.GeneratedDuration property

Gets or sets the amount of time it takes to move from one state to another, and the time that any implicit transition animations should run as part of the transition behavior.

Syntax


public Duration GeneratedDuration { get; set; }


<object GeneratedDuration="duration"/>

Property value

Type: Duration

The amount of time it takes to move from one state to another.

Remarks

GeneratedDuration is mainly for controlling implicit transitions. If you want your transition animations to be limited only to the specific animations in your Storyboard, you don't to set a value for GeneratedDuration. Instead, set specific Duration values on the animations in the Storyboard or the main Storyboard element within it. If you do set a GeneratedDuration value, it won't truncate or change any Storyboard with a Duration value; the total length of the transition is the longest Duration value that you've set in the animations for Storyboard, or the GeneratedDuration, whichever is longer.

Implicit transitions

You can define a VisualTransition such that it has a GeneratedDuration, but does not have any specific dependency properties being targeted and animated in its Storyboard value. This creates an implicit transition. Any dependency property that is specifically targeted for animation in either the From orTo visual states and thus has different values across the state change will use a generated transition animation. This generated animation transitions between the From state value and the To state value using interpolation, and lasts for the time stated by GeneratedDuration. This only works if there can be a DoubleAnimation, PointAnimation or ColorAnimation on a dependency property, for more info, see Remarks in VisualTransition.

By default, an implicit transition animation uses linear interpolation to animate a value through the GeneratedDuration. You can change the linear interpolation to an interpolation behavior of your choice by setting GeneratedEasingFunction as well as GeneratedDuration on a VisualTransition.

Examples

This example specifies that the control takes one half second to go into the "PointerOver" state.


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


Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.winmd

See also

VisualTransition
GeneratedEasingFunction
VisualStateManager
GoToState
Key-frame animations and easing functions
Quickstart: Control templates
Storyboarded animations
Storyboarded animations for visual states

 

 

Show:
© 2015 Microsoft