Show / Hide Table of Contents

Struct KeyTime

Specifies when a particular key frame should take place during an animation.

Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: System.Windows.Media.Animation
Assembly: OpenSilver.dll
Syntax
public readonly struct KeyTime

Properties

| Improve this Doc View Source

TimeSpan

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.

| Improve this Doc View Source

Type

Gets the KeyTimeType value this instance represents.

Declaration
public readonly KeyTimeType Type { get; }
Property Value
Type Description
KeyTimeType

One of the enumeration values.

| Improve this Doc View Source

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 Source

Equals(Object)

Indicates whether a KeyTime is equal to this KeyTime.

Declaration
public override readonly bool Equals(object value)
Parameters
Type Name Description
System.Object value

The KeyTime to compare with this KeyTime.

Returns
Type Description
System.Boolean

true if value is a KeyTime that represents the same length of time as this KeyTime; otherwise, false.

Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

Equals(KeyTime)

Indicates whether a specified KeyTime is equal to this KeyTime.

Declaration
public readonly bool Equals(KeyTime value)
Parameters
Type Name Description
KeyTime value

The KeyTime to compare with this KeyTime.

Returns
Type Description
System.Boolean

true if value is equal to this KeyTime; otherwise, false.

| Improve this Doc View Source

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.

| Improve this Doc View Source

FromTimeSpan(TimeSpan)

Creates a new KeyTime, using the supplied 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.

| Improve this Doc View Source

GetHashCode()

Returns a hash code representing this KeyTime.

Declaration
public override readonly int GetHashCode()
Returns
Type Description
System.Int32

A hash code identifier.

Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

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
System.ValueType.ToString()

Operators

| Improve this Doc View Source

Equality(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source