Share via


KeySpline Object

Included by a spline key frame to define animation progress.

XAML
<object property="keySplines" .../>
Scripting
object.property="keySplines"

keySplines Grammar

cp1x,cp1y cp2x,cp2y

Term Definition
cp1x x coordinate of the first control point.
cp1y y coordinate of the first control point.
cp2x x coordinate of the second control point.
cp2y y coordinate of the second control point.
  • The delimiter can be either a comma or a space and these delimiters are interchangeable. The syntax shown here is the most conventional usage, with commas between x,y and spaces between point pairs.
  • The values for each component of a KeySpline expressed in a string are expected to be between 0 and 1. Each control point influences the shape of the conceptual curve that controls the rate of a splined animation, changing the linear progression between 0,0 and 1,1 that would occur if there were no control points set.
  • The grammar for keySplines MUST specify exactly two control points. If you only require one control point for the curve, you can repeat the same control point.

Properties

Name

Methods

Equals, FindName, GetHost, GetValue, SetValue

Remarks

Properties that take a KeySpline use a string type conversion syntax as shown in the keySplines Grammar section above.

It is often helpful to graph or otherwise visualize the spline pattern you declare. For instance, the following illustration shows the timeline graph for a KeySpline value of "0,1 1,0". In the graph, x is the time dimension, and y is the value delta dimension. Therefore, this animation will rapidly change a value at first, only slowly change a value in the middle of its duration, then accelerate the value change again at the end.

A key spline with control points (0.25, 0.5) and (0.75, 1.0)

A key spline with control points (0.25, 0.5) and (0.75, 1.0)

KeySpline is exposed as an object to the object model (you can obtain a KeySpline through relevant properties) but none of the properties of KeySpline are settable at runtime. "ControlPoint1" and "ControlPoint2" of a KeySpline are not accessible in the Silverlight 1.0 object model.

For more information, see the following animation objects: SplineColorKeyFrame, SplineDoubleKeyFrame, SplinePointKeyFrame.

See Also

Key-Frame Animations Overview
Animation Overview