Book Image

Mastering Windows Presentation Foundation

By : Sheridan Yuen
Book Image

Mastering Windows Presentation Foundation

By: Sheridan Yuen

Overview of this book

Windows Presentation Foundation is rich in possibilities when it comes to delivering an excellent user experience. This book will show you how to build professional-grade applications that look great and work smoothly. We start by providing you with a foundation of knowledge to improve your workflow – this includes teaching you how to build the base layer of the application, which will support all that comes after it. We’ll also cover the useful details of data binding. Next, we cover the user interface and show you how to get the most out of the built-in and custom WPF controls. The final section of the book demonstrates ways to polish your applications, from adding practical animations and data validation to improving application performance. The book ends with a tutorial on how to deploy your applications and outlines potential ways to apply your new-found knowledge so you can put it to use right away.
Table of Contents (19 chapters)
Mastering Windows Presentation Foundation
About the Author
About the Reviewer
Customer Feedback

Chapter 6. Mastering Practical Animations

WPF offers a wide range of animation possibilities, from the simple to the really quite complex. 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 applications 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...