O'Reilly logo

Applied WPF 4 in Context by Raffaele Garofalo

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

Resources and Styles

WPF is able to store custom resources such as strings, images, styles, and custom data templates using a resource dictionary; by using this approach, you can store a custom style or an image in one place in the application that is visible and accessible from all the UI components.

The resources in WPF can be used, created, and modified by using either C# or the XAML markup; because the resource dictionary is nothing more than a XAML file, you can access this special container using the XAML markup. This choice is just a design choice and doesn't mean you should not access a resource using C# code.

The resources are an attached property of every XAML framework element, starting from the root element. Even if you can define ...

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