From the course: Microsoft XAML: 3 Type Converters and Resources

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Use the Pack URI to locate resource files

Use the Pack URI to locate resource files

From the course: Microsoft XAML: 3 Type Converters and Resources

Start my 1-month free trial

Use the Pack URI to locate resource files

- [Instructor] I've looked at how to work with resources that live in separate files in my project like this BrushResources. And I use what's called a MergedDictionary. Synax is a ResourceDictionary element and then add that to a MergedDictionary property. And then the Source points to the physical file itself. And the source itself is pretty straight forward, it's the name of the folder and the name of the file. Now this works if the Build Action for this ResourceDictionary is set to Page. Another scenario is you might want to take this BrushResources and embed it in second DLL. And then reuse that DLL across multiple projects. Or you might want to take the Resource file and put it out on your hard drive as a stand-alone file. In that scenario, you need to use a different syntax for specifying the location of that merged resource. That's called a pack URI, and this is what a pack URI looks like. It starts with the pack: and then //, and then next to the URI is what's called the…

Contents