15.3. Storyboards
As you've seen, WPF animations are represented by a group of animation classes. You set the relevant information, such as the starting value, ending value, and duration, using a handful of properties. This obviously makes them a great fit for XAML. What's less clear is how you wire an animation up to a particular element and property and how you trigger it at the right time.
It turns out that two ingredients are at work in any declarative animation:
A storyboard. It's the XAML equivalent of the BeginAnimation() method. It allows you to direct an animation to the right element and property.
An event trigger. It responds to a property change or event (such as the Click event of a button) and controls the storyboard. For example, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access