-api-id | -api-type |
---|---|
P:Windows.UI.Xaml.Media.Animation.Timeline.Duration |
winrt property |
Gets or sets the length of time for which this timeline plays, not counting repetitions.
<timeline Duration="[days.]hours:minutes:seconds[.fractionalSeconds]"/>
-or-
<timeline Duration="Automatic" .../>
-or-
<timeline Duration="Forever" .../>
- days
- daysAn integer value greater than or equal to 0 that specifies the number of days.
- hours
- hoursAn 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
- minutesAn 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
- secondsAn 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
- fractionalSecondsOptional. A decimal value consisting of 1 to 7 positions past the decimal point, which specifies fractional seconds.
- Automatic
- AutomaticThe literal string Automatic.
- Forever
- ForeverThe literal string Forever.
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.