DoubleKeyFrameCollection Object

Represents a collection of DoubleKeyFrame objects that can be individually accessed by index.

<DoubleKeyFrameCollection ...>
To create an object using scripting, see CreateFromXAML.


Count, Name


Add, Clear, Equals, FindName, GetHost, GetItem, GetValue, Insert, Remove, RemoveAt, SetValue


DoubleKeyFrameCollection defines no methods or properties beyond the basic Collection methods and properties. Methods such as Add or GetItem will expect or return objects that are of type DoubleKeyFrame. DoubleKeyFrame itself is an abstract class, so the items might be DiscreteDoubleKeyFrame, LinearDoubleKeyFrame, or SplineDoubleKeyFrame.

The XAML syntax for properties that use a DoubleKeyFrameCollection is an example of an implicit collection syntax, where you can omit an actual DoubleKeyFrameCollection object element. Instead, you generally include one or more DiscreteDoubleKeyFrame, LinearDoubleKeyFrame, or SplineDoubleKeyFrame object elements as child elements of a DoubleAnimationUsingKeyFrames. For more information about XAML implicit collection syntax, see XAML Syntax Overview. (Explicitly including a DoubleKeyFrameCollection object element is permissible XAML syntax, and might be useful if you intend to name the collection in XAML and manipulate its contents through script later.)

Within the DoubleKeyFrameCollection, the order of the DoubleKeyFrame object elements is not significant for purposes of how the animation runs, because the KeyTime controls the timing and therefore the order in which the key frames are executed. If a DoubleKeyFrameCollection is established with XAML, the items in the collection is the same order as the child elements are declared. It is good markup style as well as good coding style to keep the item/element order the same as the KeyTime sequence order.

See Also

Silverlight Key-Frame Animations Overview