Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 3.02 KB

discreteobjectkeyframe.md

File metadata and controls

45 lines (31 loc) · 3.02 KB
-api-id -api-type
T:Windows.UI.Xaml.Media.Animation.DiscreteObjectKeyFrame
winrt class

Windows.UI.Xaml.Media.Animation.DiscreteObjectKeyFrame

-description

Animates from the Object value of the previous key frame to its own Value using discrete values.

-xaml-syntax

<DiscreteObjectKeyFrame ...>
  <DiscreteObjectKeyFrame.Value>
    objectValue
  </DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame ...>
-or-
</DiscreteObjectKeyFrame Value="objectAsAttribute"...>

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

DiscreteObjectKeyFrame is the only keyframe type permitted in an ObjectAnimationUsingKeyFrames. There are no linear interpolations or other interpolation logic that's possible for changing object values as the animation runs. The old object is removed at the KeyTime and the new object that is the value of the keyframe with that KeyTime replaces it.

There are several scenarios where using ObjectAnimationUsingKeyFrames rather than a typed animation is useful. Some of them are:

  • Creating the Storyboard for a visual state and using a value that is a {StaticResource} markup extension reference, rather than one of the typed values. This gives you the ability to reference system theme resources from a visual state. For more info see Storyboarded animations for visual states.
  • Animating int or byte values.
  • Animating structures used in UI definitions and visual states, such as GridLength. You can't animate the properties of the structure but you can swap the entire structure value with a DiscreteObjectKeyFrame and a new GridLength.

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

-examples

-see-also

Storyboarded animations, Key-frame animations and easing function animations, Storyboarded animations for visual states, ObjectKeyFrame, ObjectAnimationUsingKeyFrames