Managing logical resources
Logical resources may be of various types, such as brushes, geometries, styles, and templates. Placing all those resources in a single file such as
App.xaml hinders maintainability. A better approach would be to separate resources of different types (or based on some other criteria) to their own files. Still, they must be referenced somehow from within a common file such as
App.xaml so they are recognized. This recipe shows how to do just that.
Make sure Visual Studio is up and running.
How to do it...
We'll create an application that separates its resources across multiple files for convenience and manageability:
- Create a new WPF Application named
- We want to create a separate file that ...