Windows.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames
July 6, 2022 ยท View on GitHub
-description
Animates the value of an Object property along a set of KeyFrames over a specified Duration.
-xaml-syntax
<ObjectAnimationUsingKeyFrames>oneOrMoreDiscreteObjectKeyFrames</ObjectAnimationUsingKeyFrames>
-remarks
-examples
The following example uses the ObjectAnimationUsingKeyFrames class to animate the Fill property of a Rectangle. This animation uses two key frames in the following manner:
- Using a DiscreteObjectKeyFrame, the Fill property of the Rectangle suddenly changes to a LinearGradientBrush after the first two seconds of the animation.
- After the third second of the animation, the Fill property is suddenly changed to a different LinearGradientBrush, which remains until the end of the animation (four seconds total).
[!code-xamlObjectanimationusingkeyframes]
[!code-csharpObjectanimationusingkeyframes_cs]
[!code-vbObjectanimationusingkeyframes_cs]
-see-also
Storyboarded animations, Timeline, ObjectKeyFrame, Timeline, ObjectKeyFrame