Chapter 16. Animation and Media

Imagine an application with a completely static appearance, which offers no visible reaction to mouse clicks or other input—it would sometimes be hard to tell whether that application was functioning or had frozen. We depend on visual feedback to assure us that applications are responding to input. Adding movement to your user interface can bring it to life, enhancing the interactive feel of the application. Animation can improve the realism of visual transitions intended to suggest physical movement, such as buttons that become visibly pushed in when clicked.

Animation is also useful for dealing with transitions from one view to another. In the real world, we are not used to seeing items materialize instantaneously out of nowhere, but computer programs often use abrupt transitions. In the very early days of cinema, editing shots to make objects or people appear suddenly was an effective way of scaring the audience, because it was such an unnatural thing to see. These days we are accustomed to unreal imagery and are not so easily shocked, but sudden transitions can still jar. Careful and subtle use of animation can make it much easier for a user to follow visual transitions, such as a move from one page to another or the appearance and disappearance of UI features.

For many years, Windows has been able to play video clips, but only as isolated islands of moving content. Animating features of ordinary controls has typically been much harder. WPF ...

Get Programming WPF, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.