Struct Duration
Represents the duration of time that a Windows.UI.Xaml.Media.Animation.Timeline is active.
Inherited Members
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public struct Duration
Constructors
| Improve this Doc View SourceDuration(TimeSpan)
Initializes a new instance of the Windows.UI.Xaml.Duration structure with the supplied System.TimeSpan value.
Declaration
public Duration(TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeSpan | Represents the initial time interval of this duration. |
Properties
| Improve this Doc View SourceAutomatic
Gets a Windows.UI.Xaml.Duration value that is automatically determined.
Declaration
public static readonly Duration Automatic { get; }
Property Value
Type | Description |
---|---|
Duration |
Forever
Gets a Windows.UI.Xaml.Duration value that represents an infinite interval.
Declaration
public static readonly Duration Forever { get; }
Property Value
Type | Description |
---|---|
Duration |
HasTimeSpan
Gets a value that indicates if this Windows.UI.Xaml.Duration represents a System.TimeSpan value.
Declaration
public readonly bool HasTimeSpan { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
TimeSpan
Gets the System.TimeSpan value that this Windows.UI.Xaml.Duration represents.
Declaration
public readonly TimeSpan TimeSpan { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
Methods
| Improve this Doc View SourceEquals(Object)
Determines whether a specified object is equal to a Windows.UI.Xaml.Duration.
Declaration
public override bool Equals(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Object to check for equality. |
Returns
Type | Description |
---|---|
System.Boolean | true if value is equal to this Windows.UI.Xaml.Duration; otherwise, false. |
Overrides
Equals(Duration)
Determines whether a specified Windows.UI.Xaml.Duration is equal to this Windows.UI.Xaml.Duration.
Declaration
public bool Equals(Duration duration)
Parameters
Type | Name | Description |
---|---|---|
Duration | duration | The Windows.UI.Xaml.Duration to check for equality. |
Returns
Type | Description |
---|---|
System.Boolean | true if duration is equal to this Windows.UI.Xaml.Duration; otherwise, false. |
Equals(Duration, Duration)
Determines whether two Windows.UI.Xaml.Duration values are equal.
Declaration
public static bool Equals(Duration t1, Duration t2)
Parameters
Type | Name | Description |
---|---|---|
Duration | t1 | First Windows.UI.Xaml.Duration to compare. |
Duration | t2 | Second Windows.UI.Xaml.Duration to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if t1 is equal to t2; otherwise, false. |
GetHashCode()
Gets a hash code for this object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code identifier. |
Overrides
Operators
| Improve this Doc View SourceEquality(Duration, Duration)
Determines whether two Windows.UI.Xaml.Duration cases are equal.
Declaration
public static bool operator ==(Duration t1, Duration t2)
Parameters
Type | Name | Description |
---|---|---|
Duration | t1 | The first Windows.UI.Xaml.Duration to compare. |
Duration | t2 | The second Windows.UI.Xaml.Duration to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if both Windows.UI.Xaml.Duration values have equal property values, or if all Windows.UI.Xaml.Duration values are null. Otherwise, this method returns false. |
Implicit(TimeSpan to Duration)
Implicitly creates a Duration from a given System.TimeSpan.
Declaration
public static implicit operator Duration(TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeSpan | System.TimeSpan from which a Duration is implicitly created. |
Returns
Type | Description |
---|---|
Duration | A created Duration. |
Inequality(Duration, Duration)
Determines if two Windows.UI.Xaml.Duration cases are not equal.
Declaration
public static bool operator !=(Duration t1, Duration t2)
Parameters
Type | Name | Description |
---|---|---|
Duration | t1 | The first Windows.UI.Xaml.Duration to compare. |
Duration | t2 | The second Windows.UI.Xaml.Duration to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if exactly one of t1 or t2 represent a value, or if they both represent values that are not equal; otherwise, false. |
Subtraction(Duration, Duration)
Subtracts the value of one Windows.UI.Xaml.Duration from another.
Declaration
public static Duration operator -(Duration t1, Duration t2)
Parameters
Type | Name | Description |
---|---|---|
Duration | t1 | The first Windows.UI.Xaml.Duration. |
Duration | t2 | The Windows.UI.Xaml.Duration to subtract. |
Returns
Type | Description |
---|---|
Duration |
UnaryPlus(Duration)
Returns the specified Windows.UI.Xaml.Duration.
Declaration
public static Duration operator +(Duration duration)
Parameters
Type | Name | Description |
---|---|---|
Duration | duration | The Windows.UI.Xaml.Duration to get. |
Returns
Type | Description |
---|---|
Duration | The Windows.UI.Xaml.Duration operation result. |