Delen via


DiscreteObjectKeyFrame Class

Definition

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

public ref class DiscreteObjectKeyFrame sealed : ObjectKeyFrame
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DiscreteObjectKeyFrame final : ObjectKeyFrame
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class DiscreteObjectKeyFrame final : ObjectKeyFrame
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DiscreteObjectKeyFrame : ObjectKeyFrame
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class DiscreteObjectKeyFrame : ObjectKeyFrame
Public NotInheritable Class DiscreteObjectKeyFrame
Inherits ObjectKeyFrame
<DiscreteObjectKeyFrame ...>
  <DiscreteObjectKeyFrame.Value>
    objectValue
  </DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame ...>
-or-
</DiscreteObjectKeyFrame Value="objectAsAttribute"...>
Inheritance
Object Platform::Object IInspectable DependencyObject ObjectKeyFrame DiscreteObjectKeyFrame
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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.

Constructors

DiscreteObjectKeyFrame()

Initializes a new instance of the DiscreteObjectKeyFrame class.

Properties

Dispatcher

Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread.

(Inherited from DependencyObject)
KeyTime

Gets or sets the time at which the key frame's target Value should be reached.

(Inherited from ObjectKeyFrame)
Value

Gets or sets the key frame's target value.

(Inherited from ObjectKeyFrame)

Methods

ClearValue(DependencyProperty)

Clears the local value of a dependency property.

(Inherited from DependencyObject)
GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

(Inherited from DependencyObject)
GetValue(DependencyProperty)

Returns the current effective value of a dependency property from a DependencyObject.

(Inherited from DependencyObject)
ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

(Inherited from DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance.

(Inherited from DependencyObject)
SetValue(DependencyProperty, Object)

Sets the local value of a dependency property on a DependencyObject.

(Inherited from DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback.

(Inherited from DependencyObject)

Applies to

See also