Redigera

Dela via


KeyTime Struct

Definition

During the relative course of an animation, a KeyTime instance specifies the precise timing when a particular key frame should take place.

public value class KeyTime : IEquatable<System::Windows::Media::Animation::KeyTime>
[System.ComponentModel.TypeConverter(typeof(System.Windows.KeyTimeConverter))]
public struct KeyTime : IEquatable<System.Windows.Media.Animation.KeyTime>
[<System.ComponentModel.TypeConverter(typeof(System.Windows.KeyTimeConverter))>]
type KeyTime = struct
Public Structure KeyTime
Implements IEquatable(Of KeyTime)
Inheritance
KeyTime
Attributes
Implements

Remarks

Each key frame's KeyTime specifies when that key frame ends. It does not specify how long the key time plays. The amount of time a key frame plays is determined by when the key frame ends, when the previous key frame ended, and the animation's duration. See Key-Frame Animations Overview for more information.

A KeyTime may be expressed in several different formats, including a numeric time value, as a percentage, or as one of the special sentinel values Uniform or Paced.

XAML Attribute Usage

<object property="[days.]hours:minutes:seconds[.fractionalSeconds]"/>

-or-

<object property="[days.]hours:minutes"/>

-or-

<object property="pctValue%"/>

-or-

<object property="Uniform"/>

-or-

<object property="Paced"/>

XAML Values

days
An integer value greater than or equal to 0 that specifies the number of days spanned by this KeyTime. For more information, see the TimeSpan property.

hours
An integer value between 0 and 23 that specifies the number of hours spanned by this KeyTime. For more information, see the TimeSpan property.

minutes
An integer value between 0 and 59 that specifies the number of minutes spanned by this KeyTime. For more information, see the TimeSpan property.

seconds
A floating-point value between 0 and 59 that specifies the number of seconds spanned by this KeyTime. For more information, see the TimeSpan property.

fractionalSeconds
An integer value consisting of 1 to 7 digits that specifies fractional seconds. For more information, see the TimeSpan property.

pctValue
A floating-point value between 0 and 100, inclusive, that specifies this KeyTime as a percentage of the animation's total duration. This should be followed by the literal character %.For more information, see the Percent property.

Properties

Paced

Gets the Paced value which creates timing behavior resulting in an animation that interpolates at a constant rate.

Percent

Gets the time when the key frame ends expressed as a percentage of the total duration of the animation.

TimeSpan

Gets the time when the key frame ends expressed as a time relative to the beginning of the animation.

Type

Gets the Type value this instance represents.

Uniform

Gets the Uniform value which divides the allotted time of the animation evenly between key frames.

Methods

Equals(KeyTime)

Indicates whether this instance is equal to the specified KeyTime.

Equals(KeyTime, KeyTime)

Indicates whether the two specified KeyTime structures are equal.

Equals(Object)

Indicates whether this instance equals the specified object.

FromPercent(Double)

Creates a new KeyTime instance, with the KeyTimeType property initialized to the value of the specified parameter.

FromTimeSpan(TimeSpan)

Creates a new KeyTime instance, with the KeyTimeType property initialized to the value of the specified parameter.

GetHashCode()

Returns an integer hash code representing this instance.

ToString()

Returns a string representing this KeyTime instance.

Operators

Equality(KeyTime, KeyTime)

Overloaded operator that compares two KeyTime structures for equality.

Implicit(TimeSpan to KeyTime)

Overloaded operator that implicitly converts a TimeSpan to a KeyTime.

Inequality(KeyTime, KeyTime)

Overloaded operator that compares two KeyTime structures for inequality.

Applies to