Chapter 12. Styles

What Are Styles?

In the previous chapter, you saw how to declare and save the value of a dependency property as a logical resource in a resource collection. Once the resource is declared, you can then use it anywhere below the declaration in the element tree, without having to re-define it each time. Also, if you need to change the value of the property, you can do it in just one place, and the change is reflected in all the locations that use it.

Logical resources are very useful, as far as they go—but their limitation is that each resource corresponds to a single property. Most of the time when you're setting the look and feel of a UI, you want to set the values of a group of properties. Ideally, you want to define the values ...

Get Illustrated WPF now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.