Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 2.7 KB

objectanimationusingkeyframes.md

File metadata and controls

50 lines (32 loc) · 2.7 KB
-api-id -api-type
T:Windows.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames
winrt class

Windows.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames

-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:

  1. Using a DiscreteObjectKeyFrame, the Fill property of the Rectangle suddenly changes to a LinearGradientBrush after the first two seconds of the animation.
  2. 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