O'Reilly logo

Illustrated WPF by Daniel Solis

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

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

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