Gets or sets the length of time for which this timeline plays, not counting repetitions.
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
A timeline's simple duration constitutes the time for a single forward iteration versus the total play time, which includes repetitions.
Default Duration Behavior
The behavior of a structure with a value of Automatic depends on the type of timeline:
ParallelTimeline and Storyboard are types of TimelineGroup objects. The duration of a TimelineGroup is determined by the duration of its child timelines. For example, the Storyboard below will run for six seconds (duration of 6 seconds) because that is when its last child Timeline (DoubleAnimation) ends.
Note: code has been omitted from the following examples, which are provided for illustrative purposed only.
... <Storyboard> <DoubleAnimation Duration="0:0:2" …/> <DoubleAnimation Duration="0:0:4" BeginTime="0:0:2" …/> </Storyboard> ...
... <!-- With no Duration specified, this animation will run for one second --> <DoubleAnimation .../> ...
Examples of <Type>AnimationUsingKeyFrames include DoubleAnimationUsingKeyFrames, PointAnimationUsingKeyFrames, etc. If no is specified for these types of animations they will run until all key frames are finished.
... <Storyboard> <!-- This key frame animation will end at 4.5 seconds Because that is when its last KeyFrame KeyTime ends. --> <DoubleAnimationUsingKeyFrames ...> <LinearDoubleKeyFrame ... KeyTime="0:0:3" /> <DiscreteDoubleKeyFrame ... KeyTime="0:0:3.5" /> <DiscreteDoubleKeyFrame ... KeyTime="0:0:4" /> <DiscreteDoubleKeyFrame ... KeyTime="0:0:4.5" /> </DoubleAnimationUsingKeyFrames> </Storyboard> ...
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.