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 States

You might have noticed that something is still missing from all versions of the custom Button template used in the preceding section. None of them have any visual reaction to being pressed, hovered over, or disabled. This might not be that big of a deal, depending on their usage, but imagine applying the same template to CheckBox or ToggleButton. (This can be done by changing the TargetType to ButtonBase or a more specific type.) Because the template doesn’t show different visuals for the Checked versus Unchecked versus Indeterminate states, it’s a pretty lousy template for these controls!

Therefore, a good control template must consider all possible visual states relevant for the target control and handle them appropriately. To ...

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