To apply a local animation to a property, use the BeginAnimation method. This method takes two parameters: a DependencyProperty that specifies the property to animate, and the animation to apply to that property.

The following example shows how to animate the width and background color of a Button.