Export (0) Print
Expand All

KeyTime Structure

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

Namespace:  System.Windows.Media.Animation
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

[TypeConverterAttribute(typeof(KeyTimeConverter))]
public struct KeyTime : IEquatable<KeyTime>
<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.

The KeyTime type exposes the following members.

  NameDescription
Public propertyStatic memberPacedGets the Paced value which creates timing behavior resulting in an animation that interpolates at a constant rate.
Public propertyPercentGets the time when the key frame ends expressed as a percentage of the total duration of the animation.
Public propertyTimeSpanGets the time when the key frame ends expressed as a time relative to the beginning of the animation.
Public propertyTypeGets the Type value this instance represents.
Public propertyStatic memberUniformGets the Uniform value which divides the allotted time of the animation evenly between key frames.
Top

  NameDescription
Public methodEquals(KeyTime)Indicates whether this instance is equal to the specified KeyTime.
Public methodEquals(Object)Indicates whether this instance equals the specified object. (Overrides ValueType.Equals(Object).)
Public methodStatic memberEquals(KeyTime, KeyTime)Indicates whether the two specified KeyTime structures are equal.
Public methodStatic memberFromPercentCreates a new KeyTime instance, with the KeyTimeType property initialized to the value of the specified parameter.
Public methodStatic memberFromTimeSpanCreates a new KeyTime instance, with the KeyTimeType property initialized to the value of the specified parameter.
Public methodGetHashCodeReturns an integer hash code representing this instance. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string representing this KeyTime instance. (Overrides ValueType.ToString().)
Top

  NameDescription
Public operatorStatic memberEqualityOverloaded operator that compares two KeyTime structures for equality.
Public operatorStatic memberImplicit(TimeSpan to KeyTime)Overloaded operator that implicitly converts a TimeSpan to a KeyTime.
Public operatorStatic memberInequalityOverloaded operator that compares two KeyTime structures for inequality.
Top

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft