-api-id | -api-type |
---|---|
T:Windows.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames |
winrt class |
Animates the value of an Object property along a set of KeyFrames over a specified Duration.
<ObjectAnimationUsingKeyFrames>oneOrMoreDiscreteObjectKeyFrames</ObjectAnimationUsingKeyFrames>
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]
Storyboarded animations, Timeline, ObjectKeyFrame, Timeline, ObjectKeyFrame