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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access