WPF offers a wide range of animation possibilities, from the simple to the really quite complex. In this chapter, we will thoroughly explore the WPF property animation system, yet focus primarily on those parts that can be suitably applied to real-world business applications. We'll investigate how to control running animations in real time and predominantly concentrate on XAML-based syntax. We'll then see how we can build animations right into our application framework.
In WPF, animations are created by repeatedly altering individual property values at regular intervals. Animations are comprised of a number of components: we need a timing system, an animation object that is responsible for updating the values of a particular type of object and a suitable property to animate.
In order to be able to animate a property, it must be a Dependency Property of a DependencyObject and its type must implement the IAnimatable interface. As most UI controls extend the DependencyObject class, this enables us to animate the properties of most controls.
Furthermore, an animation object for the relevant type of property must exist. In WPF, the animation objects also double up as the timing system, as they extend the Timeline class. Before investigating the various animation objects, let's first examine the timing system.