DiscreteObjectKeyFrame class

Applies to Windows and Windows Phone

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

Inheritance

Object
  DependencyObject
    ObjectKeyFrame
      DiscreteObjectKeyFrame

Syntax


public sealed class DiscreteObjectKeyFrame : ObjectKeyFrame


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

XAML Values

objectValue

An object element that declares the value of the object to use for the key frame.

objectAsAttribute

A string attribute value that can be converted to an object value.

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The DiscreteObjectKeyFrame class has these types of members:

Constructors

The DiscreteObjectKeyFrame class has these constructors.

ConstructorDescription
DiscreteObjectKeyFrame Initializes a new instance of the DiscreteObjectKeyFrame class.

 

Methods

The DiscreteObjectKeyFrame class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The DiscreteObjectKeyFrame class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

KeyTime

Read/writeGets or sets the time at which the key frame's target Value should be reached. (Inherited from ObjectKeyFrame)

Value

Read/writeGets or sets the key frame's target value. (Inherited from ObjectKeyFrame)

 

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

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Animation
Windows::UI::Xaml::Media::Animation [C++]

Metadata

Windows.winmd

See also

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

 

 

Show:
© 2014 Microsoft. All rights reserved.