Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-animate-a-property-by-using-an-animationclock.md
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

2.6 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Animate a Property by Using an AnimationClock 03/30/2017
csharp
vb
animation [WPF], properties [WPF], with AnimationClocks
AnimationClocks [WPF]
e6542021-714c-4675-9567-04f1c7380834

How to: Animate a Property by Using an AnimationClock

This example shows how to use xref:System.Windows.Media.Animation.Clock objects to animate a property.

There are three ways to animate a dependency property:

xref:System.Windows.Media.Animation.Storyboard objects and the xref:System.Windows.Media.Animation.Animatable.BeginAnimation%2A method enable you to animate properties without directly creating and distributing clocks (for examples, see Animate a Property by Using a Storyboard and Animate a Property Without Using a Storyboard); clocks are created and distributed for you automatically.

Example

The following example shows how to create an xref:System.Windows.Media.Animation.AnimationClock and apply it to two similar properties.

[!code-csharptimingbehaviors_procedural_snip#GraphicsMMCreateAnimationClockWholeClass] [!code-vbtimingbehaviors_procedural_snip#GraphicsMMCreateAnimationClockWholeClass]

For an example showing how to interactively control a xref:System.Windows.Media.Animation.Clock after it starts, see Interactively Control a Clock.

See also