ContentElement.ApplyAnimationClock Method

Definition

Applies an animation to a specified dependency property on this element.

Overloads

ApplyAnimationClock(DependencyProperty, AnimationClock)

Applies an animation to a specified dependency property on this element. Any existing animations are stopped and replaced with the new animation.

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

Applies an animation to a specified dependency property on this element, with the ability to specify what happens if the property already has a running animation.

ApplyAnimationClock(DependencyProperty, AnimationClock)

Applies an animation to a specified dependency property on this element. Any existing animations are stopped and replaced with the new animation.

C#
public void ApplyAnimationClock(System.Windows.DependencyProperty dp, System.Windows.Media.Animation.AnimationClock clock);

Parameters

dp
DependencyProperty

The identifier for the property to animate.

clock
AnimationClock

The animation clock that controls and declares the animation.

Implements

Remarks

To remove an animation from a property, specify the identifier for that property as dp and specify clock as null. This removes the animation and the animated property is set to its base value. However, the originally associated animation clock is not stopped. Any other animations assigned to that clock will continue to run.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

Applies an animation to a specified dependency property on this element, with the ability to specify what happens if the property already has a running animation.

C#
public void ApplyAnimationClock(System.Windows.DependencyProperty dp, System.Windows.Media.Animation.AnimationClock clock, System.Windows.Media.Animation.HandoffBehavior handoffBehavior);

Parameters

dp
DependencyProperty

The property to animate.

clock
AnimationClock

The animation clock that controls and declares the animation.

handoffBehavior
HandoffBehavior

A value of the enumeration. The default is SnapshotAndReplace, which will stop any existing animation and replace with the new one.

Implements

Remarks

To remove an animation from a property, specify the identifier for that property as dp and specify clock as null. This removes the animation and the animated property is set to its base value. However, the originally associated animation clock is not stopped. Any other animations assigned to that clock will continue to run.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9