Accessing binary resources from another assembly
Sometimes binary resources are defined in one assembly (typically a class library), but are needed in another assembly (another class library or an executable). WPF provides a uniform and consistent way of accessing these resources using the pack URI scheme. Let's see how to do this.
Make sure Visual Studio is up and running.
How to do it...
We'll create two assemblies—one that holds resources, and another that needs to use those resources:
- Create a new blank solution by selecting File | New Project from the main menu and then navigating to Other Project Types | Visual Studio Solutions. Name it
- Right-click on the Solution node in Solution explorer, and select Add | ...