DurationHelper DurationHelper DurationHelper DurationHelper Class

Definition

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

public : sealed class DurationHelper
struct winrt::Windows::UI::Xaml::DurationHelper
public sealed class DurationHelper
Public NotInheritable Class DurationHelper
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 Microsoft 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 Microsoft Visual Basic developer could use directly on Duration are available in a static form on the DurationHelper class.

Properties

Automatic Automatic Automatic Automatic

Returns a generated Duration value that indicates an "Automatic" Duration. C# and Microsoft Visual Basic code should use Duration.Automatic instead.

Forever Forever Forever Forever

Returns a generated Duration value that indicates a "Forever" Duration. C# and Microsoft Visual Basic code should use Duration.Forever instead.

Methods

Add(Duration, Duration) Add(Duration, Duration) Add(Duration, Duration) Add(Duration, Duration)

Adds the TimeSpan component of two Duration values. C# and Microsoft Visual Basic code should use the Addition (+) operator or the Duration.Add method instead.

Compare(Duration, Duration) Compare(Duration, Duration) Compare(Duration, Duration) Compare(Duration, Duration)

Compares value equality of two Duration structures. C# and Microsoft Visual Basic code should use Duration.Compare instead.

Equals(Duration, Duration) Equals(Duration, Duration) Equals(Duration, Duration) Equals(Duration, Duration)

Determines whether two Duration values have equivalent values. C# and Microsoft Visual Basic code should use the Equality (=) operator or Duration.Equals method instead.

FromTimeSpan(TimeSpan) FromTimeSpan(TimeSpan) FromTimeSpan(TimeSpan) FromTimeSpan(TimeSpan)

Creates a new Duration based on a TimeSpan value. C# and Microsoft Visual Basic code should use the Duration(TimeSpan) constructor instead.

GetHasTimeSpan(Duration) GetHasTimeSpan(Duration) GetHasTimeSpan(Duration) GetHasTimeSpan(Duration)

Returns whether the TimeSpan component of a given Duration holds a non-null value. C# and Microsoft Visual Basic code should use Duration.HasTimeSpan instead.

Subtract(Duration, Duration) Subtract(Duration, Duration) Subtract(Duration, Duration) Subtract(Duration, Duration)

Subtracts the TimeSpan component of one Duration value from another Duration value. C# and Microsoft Visual Basic code should use the Subtraction (-) operator or the Duration.Subtract method instead.

See also