Struct KeyTime
Specifies when a particular key frame should take place during an animation.
Inherited Members
Namespace: System.Windows.Media.Animation
Assembly: OpenSilver.dll
Syntax
public readonly struct KeyTime
Properties
| Improve this Doc View SourceTimeSpan
Gets the time when the key frame ends, expressed as a time relative to the beginning of the animation.
Declaration
public readonly TimeSpan TimeSpan { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan | The time when the key frame ends, expressed as a time relative to the beginning of the animation. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | If this instance is not of type TimeSpan. |
Type
Gets the KeyTimeType value this instance represents.
Declaration
public readonly KeyTimeType Type { get; }
Property Value
Type | Description |
---|---|
KeyTimeType | One of the enumeration values. |
Uniform
Gets a uniform value, which divides the allotted time of the animation evenly between key frames.
Declaration
public static readonly KeyTime Uniform { get; }
Property Value
Type | Description |
---|---|
KeyTime | A uniform value, which divides the allotted time of the animation evenly between key frames. |
Methods
| Improve this Doc View SourceEquals(Object)
Declaration
public override readonly bool Equals(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Returns
Type | Description |
---|---|
System.Boolean | true if value is a KeyTime that represents the same length of time as this KeyTime; otherwise, false. |
Overrides
Equals(KeyTime)
Declaration
public readonly bool Equals(KeyTime value)
Parameters
Type | Name | Description |
---|---|---|
KeyTime | value |
Returns
Type | Description |
---|---|
System.Boolean | true if value is equal to this KeyTime; otherwise, false. |
Equals(KeyTime, KeyTime)
Indicates whether two KeyTime values are equal.
Declaration
public static bool Equals(KeyTime keyTime1, KeyTime keyTime2)
Parameters
Type | Name | Description |
---|---|---|
KeyTime | keyTime1 | The first value to compare. |
KeyTime | keyTime2 | The second value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if the values of keyTime1 and keyTime2 are equal; otherwise, false. |
FromTimeSpan(TimeSpan)
Declaration
public static KeyTime FromTimeSpan(TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeSpan | The value of the new KeyTime. |
Returns
Type | Description |
---|---|
KeyTime | A new KeyTime, initialized to the value of timeSpan. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | The specified timeSpan is outside the allowed range. |
GetHashCode()
Returns a hash code representing this KeyTime.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code identifier. |
Overrides
ToString()
Returns a string representation of this KeyTime.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of this KeyTime. |
Overrides
Operators
| Improve this Doc View SourceEquality(KeyTime, KeyTime)
Compares two KeyTime values for equality.
Declaration
public static bool operator ==(KeyTime keyTime1, KeyTime keyTime2)
Parameters
Type | Name | Description |
---|---|---|
KeyTime | keyTime1 | The first value to compare. |
KeyTime | keyTime2 | The second value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if keyTime1 and keyTime2 are equal; otherwise, false. |
Implicit(TimeSpan to KeyTime)
Implicitly converts a System.TimeSpan to a KeyTime.
Declaration
public static implicit operator KeyTime(TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeSpan | The TimeSpan value to convert. |
Returns
Type | Description |
---|---|
KeyTime | The created KeyTime. |
Inequality(KeyTime, KeyTime)
Compares two KeyTime values for inequality.
Declaration
public static bool operator !=(KeyTime keyTime1, KeyTime keyTime2)
Parameters
Type | Name | Description |
---|---|---|
KeyTime | keyTime1 | The first value to compare. |
KeyTime | keyTime2 | The second value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if keyTime1 and keyTime2 are not equal; otherwise, false. |