Timeline.GetNaturalDuration Method (Clock)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns the length of a single iteration of this Timeline.

Namespace:   System.Windows.Media.Animation
Assembly:  PresentationCore (in PresentationCore.dll)

member GetNaturalDuration : 
        clock:Clock -> Duration

Parameters

clock
Type: System.Windows.Media.Animation.Clock

The Clock that was created for this Timeline.

Return Value

Type: System.Windows.Duration

The length of a single iteration of this Timeline, or Automatic if the natural duration is unknown.

This method should only be called when the Duration property is set to Automatic. If Duration is Automatic, the natural duration is determined by that particular class's implementation of GetNaturalDurationCore.

If GetNaturalDuration returns Automatic, it means that the natural duration is unknown, which implies a natural duration of Forever. Such is the case for streaming media.

Note that passing this method a clock other than the one that was created for this timeline is possible, but will provide unreliable results.

.NET Framework
Available since 3.0
Return to top
Show: