Windows Dev Center

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.

DurationHelper class

Provides basic utility methods for processing Duration values. C# and Microsoft Visual Basic code should use methods of Duration instead.

Inheritance

Object
  DurationHelper

Syntax


public ref class DurationHelper sealed 

Members

The DurationHelper class inherits from Object and IDurationHelper. DurationHelper also has these types of members:

Methods

The DurationHelper class has these methods. It also inherits methods from the Object class.

MethodDescription
Add Adds the TimeSpan component of two Duration values. C# and Microsoft Visual Basic code should use the + operator or the Add method instead.
Compare Compares value equality of two Duration structures. C# and Microsoft Visual Basic code should use Compare instead.
Equals(Duration, Duration) Determines whether two Duration values have equivalent values. C# and Microsoft Visual Basic code should use the = operator instead.
FromTimeSpan Creates a new Duration based on a TimeSpan value. C# and Microsoft Visual Basic code should Duration(TimeSpan) instead.
GetHasTimeSpan Returns whether the TimeSpan component of a given Duration holds a non-null value. C# and Microsoft Visual Basic code should use HasTimeSpan instead.
Subtract Subtracts the TimeSpan component of one Duration value from another Duration value. C# and Microsoft Visual Basic code should use the - operator or the Subtract method instead.

 

Properties

The DurationHelper class has these properties.

PropertyAccess typeDescription

Automatic

Read-onlyReturns a generated Duration value that indicates an Automatic Duration. C# and Microsoft Visual Basic code should use Automatic instead.

Forever

Read-onlyReturns a generated Duration value that indicates a Forever Duration. C# and Microsoft Visual Basic code should use Forever instead.

 

Remarks

Duration is a Windows Runtime structure that represents a unit of time for an animation behavior. For example, Timeline.Duration uses a Duration value.

DurationHelper is one of several Helper classes that are intended to provide utility methods for Windows Runtime structure values. C# and Visual Basic code can use members of Duration instead, because utility members are available directly on the structure due to .NET Framework runtime support. C++ code can only access the Timespan data value on Duration. For C++ developers, approximately the same utility features that a Visual Basic developer could use directly on Duration are available in a static form on the DurationHelper class.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows::UI::Xaml

Metadata

Windows.Foundation.UniversalApiContract.winmd

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

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows::UI::Xaml

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

See also

Object
Duration
Storyboarded animations

 

 

Show:
© 2015 Microsoft