WPF’s resource system is simply a way of keeping around a set of useful objects, such as commonly used brushes, styles, or templates, so you can reuse them more easily.

Although you can create and manipulate resources in code, you’ll usually define them in your XAML markup. After a resource is defined, you can use it throughout the rest of the markup in your window (or, in the case of an application resource, throughout the rest of your application). This technique simplifies your markup, saves repetitive coding, and allows you to store user interface details (such as your application’s color scheme) in a central place so ...

Get Pro WPF 4.5 in VB: Windows Presentation Foundation in .NET 4.5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.