Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Timeline.Duration property

Applies to Windows and Windows Phone

Gets or sets the length of time for which this timeline plays, not counting repetitions.

Syntax


public Duration Duration { get; set; }


<timeline Duration="[days.]hours:minutes:seconds[.fractionalSeconds]"/>
-or-
<timeline Duration="Automatic" .../>
-or-
<timeline Duration="Forever" .../>

XAML Values

days

An integer value greater than or equal to 0 that specifies the number of days.

hours

An integer value between 0 and 23 that specifies the number of hours. If you specify a Duration as a XAML attribute, an hours component is required, even if is 0.

minutes

An integer value between 0 and 59 that specifies the number of minutes. Set hours:minutes components as 0:0 if you are setting only a seconds component.

seconds

An integer value between 0 and 59 that specifies the number of seconds. Set hours:minutes components as 0:0 if you are setting only a seconds component.

fractionalSeconds

Optional. A decimal value consisting of 1 to 7 positions past the decimal point, which specifies fractional seconds.

Automatic

The literal string Automatic.

Forever

The literal string Forever.

Property value

Type: Duration

The timeline's simple duration: the amount of time this timeline takes to complete a single forward iteration. The default value is a Duration that evaluates as Automatic.

Remarks

A Duration value has a TimeSpan component.

  • For Visual C++ component extensions (C++/CX), the data value of a Duration is a property named TimeSpan. This has a TimeSpan structure value, and that structure has a field named Duration that reports the duration as an int64 that counts in 100-nanosecond units. TimeSpan doesn't have any methods for getting components of the time in hours:minutes:seconds format.
  • For C# or Microsoft Visual Basic, you can use utility methods of System.TimeSpan to get the duration components in whatever format you want. For example you can get TimeSpan.Hours, TimeSpan.Minutes and TimeSpan.Seconds separately.
  • For more info, see Remarks in the Duration reference topic.

Requirements

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.Media.Animation
Windows::UI::Xaml::Media::Animation [C++]

Metadata

Windows.winmd

See also

Timeline
Storyboarded animations

 

 

Show:
© 2014 Microsoft. All rights reserved.