WPF includes a sophisticated and elegant animation engine that takes animations to the declarative level. Instead of dealing with timers and graphic updates, an animation object holds all the required information for the animation to commence. WPF does the rest. In this recipe, we'll take a look at property-based animations - the simplest and most often used kind.
Make sure Visual Studio is up and running.
We'll create some property-based animations on some shapes inside a Canvas, showing the basic steps involved in creating animations:
MainWindow.xaml. Add the following two rows to the existing