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.Compare method

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

Syntax


public:
static int Compare(
  Duration duration1, 
  Duration duration2
)

Parameters

duration1

Type: Duration

The first Duration to compare.

duration2

Type: Duration

The second Duration to compare.

Return value

Type: Int32

If duration1 is less than duration2, a negative value that represents the difference. If duration1 is equal to duration2, zero. If duration1 is greater than duration2, a positive value that represents the difference.

Remarks

Duration instances with a value of Automatic are a special case with the following return values:

  • If duration1 is Automatic and duration2 is not, -1 is returned.
  • If duration1 is Automatic and duration2 is also Automatic, 0 is returned.
  • If duration1 is not Automatic and duration2 is Automatic, 1 is returned.

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

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows::UI::Xaml

Metadata

Windows.winmd

See also

DurationHelper

 

 

Show:
© 2015 Microsoft