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
From the course: Microsoft XAML: 3 Type Converters and Resources
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Types of resources6m 31s
-
XAML resources and ResourceDictionaries4m 4s
-
The Resources property2m 44s
-
Use resource with the StaticResource markup extensions3m 46s
-
Styles in resources1m 23s
-
Colors in resources1m 29s
-
Data and templates in resources3m 3s
-
Explore the resource hierarchy2m 51s
-
Create Resources with the Properties window5m 54s
-
A quick look at merged resources5m 24s
-
Use the Pack URI to locate resource files2m 39s
-
Load a resource file for dynamic application UI2m 6s
-
-