This documentation is archived and is not being maintained.

Animatable::ApplyAnimationClock Method (DependencyProperty, AnimationClock)

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

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

public:
virtual void ApplyAnimationClock(
	DependencyProperty^ dp, 
	AnimationClock^ clock
) sealed

Parameters

dp
Type: System.Windows::DependencyProperty
The property to animate.
clock
Type: System.Windows.Media.Animation::AnimationClock
The clock with which to animate the specified property. If clock is nullptr, all animations will be removed from the specified property (but not stopped).

Implements

IAnimatable::ApplyAnimationClock(DependencyProperty, AnimationClock)

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

This example shows how to use Clock objects to animate a property.

There are three ways to animate a dependency property:

Storyboard objects and the BeginAnimation method enable you to animate properties without directly creating and distributing clocks (for examples, see How to: Animate a Property by Using a Storyboard and How to: Animate a Property Without Using a Storyboard); clocks are created and distributed for you automatically.

The following example shows how to create an AnimationClock and apply it to two similar properties.

No code example is currently available or this language may not be supported.

For an example showing how to interactively control a Clock after it starts, see How to: Interactively Control a Clock.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: