July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Until now, you saw how styles can be applied to controls without condition. This is useful, but it is more useful for deciding when to apply a style. The easiest example is to consider a button: You apply a background color that you might want to change when the button gets focus; this behavior should be replicated for each button in the UI via styles. To conditionally apply styles, you use triggers. A trigger essentially represents a condition that enables you to apply a particular style when the condition is evaluated as True. Triggers are defined within a Style.Triggers collection, and each of them requires you to specify the property affected by the condition and a Boolean value (True or False) that determines when ...