Chapter 2. Resources

In this chapter we will cover:

  • Using logical resources
  • Dynamically binding to a logical resource
  • Using user selected colors and fonts
  • Using binary resources
  • Accessing binary resources in code
  • Accessing binary resources from another assembly
  • Managing logical resources

Introduction

Traditional application resources consist of binary chunks of data, typically representing things such as icons, bitmaps, strings, and XML. In fact, the .NET framework provides generic support for these through the ResourceManager class.

WPF is no different—binary resources play an important role in a typical application. However, WPF goes a lot further with another kind of resource: logical resources. These are objects, any objects, which can be shared and ...

Get Windows Presentation Foundation 4.5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.