The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

KeySpline Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

This class is used by a spline key frame to define animation progress.


Namespace:  System.Windows.Media.Animation
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public sealed class KeySpline : DependencyObject
<KeySpline .../>
<object property="controlPoint1 controlPoint2"/>

XAML Values


The curve's first control point, expressed as an x,y pair. The point's X and Y values must each be between 0 and 1, inclusive. For more information, see the ControlPoint1 property.


The curve's second control point, expressed as an x,y pair. The point's X and Y values must each be between 0 and 1, inclusive. For more information, see the ControlPoint2 property.

The KeySpline type exposes the following members.

Public methodKeySplineInitializes a new instance of the KeySpline class.

Public propertyControlPoint1Gets or sets the first control point used to define a Bezier curve that describes a KeySpline.
Public propertyControlPoint2Gets or sets the second control point used to define a Bezier curve that describes a KeySpline.
Public propertyDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)

Public methodCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetAnimationBaseValueReturns any base value established for a Windows Phone dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

To understand how a KeySpline works, it is helpful to understand cubic Bezier curves. A cubic Bezier curve is defined by a start point, an end point, and two control points. The two coordinates in the KeySpline defines those two control points. When describing key splines, the start point of the Bezier curve is always 0, and the end point is always 1, which is why you define only the two control points. The resulting curve specifies how an animation is interpolated during a time segment; that is, the curve represents the rate of change in the animation's target attribute over the time segment.

XAML object element syntax for KeySpline (to fill a KeySpline property in property element syntax) is possible but not common. It is more common to use attribute syntax on a KeySpline property and use the type conversion behavior to specify both ControlPoint1 and ControlPoint2 in a single string.

XAML Usage Notes

  • The two control points may also be delimited by a single comma and/or one or more spaces.

  • controlPoint1 and controlPoint2 are "logical points", not points in an actual onscreen coordinate system. See "Logical Points" section in Point.

  • The common usage is to use a comma between x,y of a point, and a space between points, for example 0,0 0.5,1.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

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