Visual Transitions
Let’s say you start with Button’s default template but morph it such that the two focus Rectangles fade in gradually when the control transitions to the Focused state. In this case, the harsh stopping of these animations when transitioning out of Focused probably won’t be satisfactory. However, because Unfocused and PointerFocused are left empty, the result is an instant jump to the default visual behavior. This could be solved by adding Storyboards with explicit animations to the default values, but one would have to be added for every property animated by any other state in the group in order to account for all possible transitions.
Fortunately, VisualStateGroup has a much better solution for this. It defines a Transitions ...
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