Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-animate-a-property-without-using-a-storyboard.md
T
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 Without Using a Storyboard 03/30/2017
csharp
vb
cpp
non-Storyboard animation
local animation [WPF]
animation [WPF], non-Storyboard (local)
d411db70-4df7-487d-82bc-95a7c1b2e7f8

How to: Animate a Property Without Using a Storyboard

This example shows one way to apply an animation to a property without using a xref:System.Windows.Media.Animation.Storyboard.

Note

This functionality is not available in [!INCLUDETLA#tla_xaml]. For information about animating a property in [!INCLUDETLA2#tla_xaml], see Animate a Property by Using a Storyboard.

To apply a local animation to a property, use the xref:System.Windows.UIElement.BeginAnimation%2A method. This method takes two parameters: a xref:System.Windows.DependencyProperty that specifies the property to animate, and the animation to apply to that property.

Example

The following example shows how to animate the width and background color of a xref:System.Windows.Controls.Button.

[!code-cppanimateproperty#11] [!code-csharpanimateproperty#11] [!code-vbanimateproperty#11]

A variety of animation classes in the xref:System.Windows.Media.Animation namespace exist for animating different types of properties. For more information about animating properties, see Animation Overview. For more information about dependency properties (the type of properties that are shown in these examples) and their features, see Dependency Properties Overview.

There are other ways to animate without using xref:System.Windows.Media.Animation.Storyboard objects; for more information, see Property Animation Techniques Overview.

See also