From the course: Microsoft XAML: 3 Type Converters and Resources
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Explore the resource hierarchy
From the course: Microsoft XAML: 3 Type Converters and Resources
Explore the resource hierarchy
- [Instructor] It's time to talk about how zaml determines which resource to use. You see here on line 25 I am setting the fill value of my rectangle to a static resource. So there's a resource somewhere defined with a key called main brush. Or is there? You see it as a blue squiggle here and the error is the resource main brush could not be resolved. And I'm getting the same error down here at line 31. So in this case I don't have a brush defined anywhere in my project with that key. And what's happening is it's looking through a list of resource dictionaries. It starts at the ellipse, sees if it has one there, then it goes to the stack panel, then it goes to the grid, then it goes up to the window and if it can't find it there then it searches elsewhere. In the highest level that it can look is over here in app.zaml. There's our resources section over here so I'll uncomment my zaml, ctrl+k, ctr+u. So this is a resource dictionary like all the other resource dictionaries we've seen…
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
-
-
-
-
(Locked)
Types of resources6m 31s
-
XAML resources and ResourceDictionaries4m 4s
-
(Locked)
The Resources property2m 44s
-
(Locked)
Use resource with the StaticResource markup extensions3m 46s
-
(Locked)
Styles in resources1m 23s
-
(Locked)
Colors in resources1m 29s
-
(Locked)
Data and templates in resources3m 3s
-
(Locked)
Explore the resource hierarchy2m 51s
-
(Locked)
Create Resources with the Properties window5m 54s
-
(Locked)
A quick look at merged resources5m 24s
-
(Locked)
Use the Pack URI to locate resource files2m 39s
-
(Locked)
Load a resource file for dynamic application UI2m 6s
-
(Locked)
-