Breyta

Deila með


Animatable.ApplyAnimationClock Method

Definition

Animates the specified DependencyProperty using the specified AnimationClock.

Overloads

ApplyAnimationClock(DependencyProperty, AnimationClock)

Applies an AnimationClock to the specified DependencyProperty. If the property is already animated, the SnapshotAndReplace handoff behavior is used.

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

Applies an AnimationClock to the specified DependencyProperty. If the property is already animated, the specified HandoffBehavior is used.

ApplyAnimationClock(DependencyProperty, AnimationClock)

Applies an AnimationClock to the specified DependencyProperty. If the property is already animated, the SnapshotAndReplace handoff behavior is used.

public:
 virtual void ApplyAnimationClock(System::Windows::DependencyProperty ^ dp, System::Windows::Media::Animation::AnimationClock ^ clock);
public void ApplyAnimationClock (System.Windows.DependencyProperty dp, System.Windows.Media.Animation.AnimationClock clock);
abstract member ApplyAnimationClock : System.Windows.DependencyProperty * System.Windows.Media.Animation.AnimationClock -> unit
override this.ApplyAnimationClock : System.Windows.DependencyProperty * System.Windows.Media.Animation.AnimationClock -> unit
Public Sub ApplyAnimationClock (dp As DependencyProperty, clock As AnimationClock)

Parameters

dp
DependencyProperty

The property to animate.

clock
AnimationClock

The clock with which to animate the specified property. If clock is null, all animations will be removed from the specified property (but not stopped).

Implements

Remarks

Note that using this method to removing clocks from a property does not stop those clocks.

Applies to

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

Applies an AnimationClock to the specified DependencyProperty. If the property is already animated, the specified HandoffBehavior is used.

public:
 virtual void ApplyAnimationClock(System::Windows::DependencyProperty ^ dp, System::Windows::Media::Animation::AnimationClock ^ clock, System::Windows::Media::Animation::HandoffBehavior handoffBehavior);
public void ApplyAnimationClock (System.Windows.DependencyProperty dp, System.Windows.Media.Animation.AnimationClock clock, System.Windows.Media.Animation.HandoffBehavior handoffBehavior);
abstract member ApplyAnimationClock : System.Windows.DependencyProperty * System.Windows.Media.Animation.AnimationClock * System.Windows.Media.Animation.HandoffBehavior -> unit
override this.ApplyAnimationClock : System.Windows.DependencyProperty * System.Windows.Media.Animation.AnimationClock * System.Windows.Media.Animation.HandoffBehavior -> unit
Public Sub ApplyAnimationClock (dp As DependencyProperty, clock As AnimationClock, handoffBehavior As HandoffBehavior)

Parameters

dp
DependencyProperty

The property to animate.

clock
AnimationClock

The clock with which to animate the specified property. If handoffBehavior is SnapshotAndReplace and clock is null, all animations will be removed from the specified property (but not stopped). If handoffBehavior is Compose and clock is null, this method has no effect.

handoffBehavior
HandoffBehavior

A value that specifies how the new animation should interact with any current animations already affecting the property value.

Implements

Examples

The following example shows how to apply animation clocks using different HandoffBehavior settings.

Remarks

Note that using this method to remove clocks from a property does not stop those clocks.

Using the Compose HandoffBehavior

When you apply a Storyboard, AnimationTimeline, or AnimationClock to a property using the Compose HandoffBehavior, any Clock objects previously associated with that property continue to consume system resources; the timing system will not remove these clocks automatically.

To avoid performance issues when you apply a large number of clocks using Compose, you should remove composing clocks from the animated property after they complete. There are several ways to remove a clock.

This is primarily an issue for animations on objects that have a long lifetime. When an object is garbage collected, its clocks will also be disconnected and garbage collected.

For more information about clock objects, see the Animation and Timing System Overview.

Applies to