ContentElement.BeginAnimation Method

Definition

Starts an animation for a specified animated property on this element.

Overloads

BeginAnimation(DependencyProperty, AnimationTimeline)

Starts an animation for a specified animated property on this element.

BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)

Starts a specific animation for a specified animated property on this element, with the option of specifying what happens if the property already has a running animation.

BeginAnimation(DependencyProperty, AnimationTimeline)

Starts an animation for a specified animated property on this element.

C#
public void BeginAnimation(System.Windows.DependencyProperty dp, System.Windows.Media.Animation.AnimationTimeline animation);

Parameters

dp
DependencyProperty

The property to animate, which is specified as a dependency property identifier.

animation
AnimationTimeline

The timeline of the animation to start.

Implements

Remarks

When you check whether a property is animated, note that the animation will begin and be considered animated when the first frame beyond the non-animated starting point is rendered.

If the BeginTime for animation is null, then any current animations are removed and the current value of the property is held.

If the entire animation value is null, all animations are removed from the property and the property value reverts to its base value. However, the originally associated animation timeline is not stopped. Any other animations assigned to that timeline 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, 10

BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)

Starts a specific animation for a specified animated property on this element, with the option of specifying what happens if the property already has a running animation.

C#
public void BeginAnimation(System.Windows.DependencyProperty dp, System.Windows.Media.Animation.AnimationTimeline animation, System.Windows.Media.Animation.HandoffBehavior handoffBehavior);

Parameters

dp
DependencyProperty

The property to animate, which is specified as the dependency property identifier.

animation
AnimationTimeline

The timeline of the animation to be applied.

handoffBehavior
HandoffBehavior

A value of the enumeration that specifies how the new animation interacts with any current (running) animations that are already affecting the property value.

Implements

Remarks

When you check whether a property is animated, note that the animation will begin and be considered animated when the first frame beyond the non-animated starting point is rendered.

If the BeginTime for animation is null, then any current animations are removed and the current value of the property is held.

If the entire animation value is null, all animations are removed from the property and the property value reverts to its base value. However, the originally associated animation timeline is not stopped. Any other animations assigned to that timeline 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, 10