O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required