Using logical resources
WPF introduces the concept of logical resources, objects that can be shared (and reused) across some part of a visual tree or an entire application. Logical resources can be anything, from WPF objects such as brushes, geometries, or styles, to other objects defined by the .NET Framework or the developer, such as
List<>, or some custom typed object. This gives a whole new meaning to the term resources. These objects are typically placed inside a
ResourceDictionary and located at runtime using a hierarchical search, as demonstrated in this recipe.
Make sure Visual Studio is up and running.
How to do it...
We'll create a simple application that demonstrates creating and using logical resources:
- Create a new ...