-api-id | -api-type |
---|---|
T:Windows.UI.Xaml.Media.Animation.DiscretePointKeyFrame |
winrt class |
Animates from the Point value of the previous key frame to its own Value using discrete frames.
<DiscretePointKeyFrame />
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.
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:
- 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.
- 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.
- 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.
[!code-xamlPointanimationusingkeyframes]
[!code-csharpPointanimationusingkeyframes_cs]
[!code-vbPointanimationusingkeyframes_cs]
Storyboarded animations, PointKeyFrame, PointAnimationUsingKeyFrames, KeyTime, Value, KeyTime, Value