Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-animate-a-property-without-using-a-storyboard.md
Andy (Steve) De George be103da07e Replace various WPF include files with content (#1335)
* net-current-v30plus-md.md

* net-current-v40plus-md.md

* tla2sharptla-ui-md.md

* tla2sharptla-uiautomation-md.md

* tla2sharptla-winclient-md.md

* tla2sharptla-xaml-md.md

* tlasharptla-ui-md.md

* tlasharptla-uiautomation-md.md

* tlasharptla-winclient-md.md

* tlasharptla-xaml-md.md

* fix warnings
2022-03-16 12:14:11 -04:00

2.4 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 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