SplinePointKeyFrame SplinePointKeyFrame SplinePointKeyFrame SplinePointKeyFrame Class

Definition

Animates from the Point value of the previous key frame to its own Value using splined interpolation.

public : sealed class SplinePointKeyFrame : PointKeyFrame, ISplinePointKeyFramepublic sealed class SplinePointKeyFrame : PointKeyFrame, ISplinePointKeyFramePublic NotInheritable Class SplinePointKeyFrame Inherits PointKeyFrame Implements ISplinePointKeyFrame// This API is not available in Javascript.
<SplinePointKeyFrame .../>
Inheritance
SplinePointKeyFrameSplinePointKeyFrameSplinePointKeyFrameSplinePointKeyFrame
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited methods

Inherited properties

Examples

This XAML example moves an ellipse along a triangular path. The example uses the PointAnimationUsingKeyFrames class to animate the Center property of an EllipseGeometry. This animation uses three key frames in the following manner:

  1. During the first half second, it uses an instance of the LinearPointKeyFrame class to move the ellipse along a path at a steady rate from its starting position. Linear key frames such as LinearPointKeyFrame create a smooth linear interpolation between values.
  2. During the end of the next half second, it uses an instance of the DiscretePointKeyFrame class to suddenly move the ellipse along the path to the next position. Discrete key frames like DiscretePointKeyFrame create sudden jumps between values.
  3. During the final two seconds, it uses an instance of the SplinePointKeyFrame class to move the ellipse back to its starting position. Spline key frames like SplinePointKeyFrame create a variable transition between values according to the values of the KeySpline property. In this example, the animation begins slowly and speeds up exponentially toward the end of the time segment.
<Canvas Width="400" Height="300">
    <Canvas.Resources>
        <Storyboard x:Name="myStoryboard">

            <!-- Animating the Center property uses 3 KeyFrames, which animate
             the ellipse allong a triangular path. -->
            <PointAnimationUsingKeyFrames
          Storyboard.TargetProperty="Center"
          Storyboard.TargetName="MyAnimatedEllipseGeometry"
          Duration="0:0:5" RepeatBehavior="Forever" EnableDependentAnimation="True">

                <!-- Over the first half second, Using a LinearPointKeyFrame, the ellipse 
               moves steadily from its starting position along the first line of the 
               trianglar path.  -->
                <LinearPointKeyFrame KeyTime="0:0:0.5" Value="100,300" />

                <!-- Using a DiscretePointKeyFrame, the ellipse suddenly changes position
               after the first second of the animation. -->
                <DiscretePointKeyFrame KeyTime="0:0:1" Value="400,300" />

                <!-- Using a SplinePointKeyFrame, the ellipse moves back to its starting
               position. It moves slowly at first and then speeds up. This key frame 
               takes 2 seconds to complete. -->
                <SplinePointKeyFrame KeySpline="0.6,0.0 0.9,0.00" 
                 KeyTime="0:0:3" Value="200,100" />
            </PointAnimationUsingKeyFrames>
        </Storyboard>
    </Canvas.Resources>
    <Path Fill="Blue" Loaded="Start_Animation">
        <Path.Data>

            <!-- Describes an ellipse. -->
            <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
             Center="200,100" RadiusX="15" RadiusY="15" />
        </Path.Data>
    </Path>
</Canvas>
// Start the animation when the object loads
private void Start_Animation(object sender, RoutedEventArgs e)
{
    myStoryboard.Begin();
}
' Start the animation when the object loads
Private Sub Start_Animation(ByVal sender As Object, ByVal e As EventArgs)
    myStoryboard.Begin()
End Sub

Remarks

Key-frame animations permit more than one target value that is reached at a point along the animation timeline. In other words each key frame can specify a different intermediate value, and the last key frame reached is the final animation value. By specifying multiple values to animate, you can make more complex animations. You can mix discrete, linear, and spline keyframes in the same keyframe collection.

For more info on how to use key-frame animations, see Key-frame animations and easing function animations.

Constructors

SplinePointKeyFrame() SplinePointKeyFrame() SplinePointKeyFrame() SplinePointKeyFrame()

Initializes a new instance of the SplinePointKeyFrame class.

public : SplinePointKeyFrame()public SplinePointKeyFrame()Public Sub New()// This API is not available in Javascript.

Properties

KeySpline KeySpline KeySpline KeySpline

Gets or sets the two control points that define animation progress for this key frame.

public : KeySpline KeySpline { get; set; }public KeySpline KeySpline { get; set; }Public ReadWrite Property KeySpline As KeySpline// This API is not available in Javascript.
<SplinePointKeyFrame KeySpline="keySplineValue"/>
Value
KeySpline KeySpline KeySpline KeySpline

The two control points that specify the cubic Bezier curve that defines the progress of the key frame.

KeySplineProperty KeySplineProperty KeySplineProperty KeySplineProperty

Identifies the KeySpline dependency property.

public : static DependencyProperty KeySplineProperty { get; }public static DependencyProperty KeySplineProperty { get; }Public Static ReadOnly Property KeySplineProperty As DependencyProperty// This API is not available in Javascript.
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the KeySpline dependency property.

See Also