Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UIElement.BeginAnimation Method (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.

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

'Declaration
Public Sub BeginAnimation ( _
	dp As DependencyProperty, _
	animation As AnimationTimeline, _
	handoffBehavior As HandoffBehavior _
)

Parameters

dp
Type: System.Windows.DependencyProperty

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

animation
Type: System.Windows.Media.Animation.AnimationTimeline

The timeline of the animation to be applied.

handoffBehavior
Type: System.Windows.Media.Animation.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

IAnimatable.BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)

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 Nothing, then any current animations are removed and the current value of the property is held.

If the entire animation value is Nothing, 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.

The following example implements a handler that obtains an existing animation from a resource and then calls BeginAnimation with a specified handoff behavior.

		Private Sub myFrameNavigated(ByVal sender As Object, ByVal args As NavigationEventArgs)
			Dim myFadeInAnimation As DoubleAnimation = CType(Me.Resources("MyFadeInAnimationResource"), DoubleAnimation)
			myFrame.BeginAnimation(Frame.OpacityProperty, myFadeInAnimation, HandoffBehavior.SnapshotAndReplace)
		End Sub

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft