In Silverlight, I have a xaml page that contains a resource dictionary defining many different things. Then, I have a child window control in a completely seperate xaml page and when I set a background color to a grid to a staticresource, it is able to find those colors defined in that resource dictionary. I can’t figure out how exactly it is finding it though. There are no lines in my child window xaml page that is obvious to me that says “here is the resource dictionary to look at.”
Could someone tell me how it is finding these resources?
To resolve resource references, it climbs up the hierarchy checking the resource dictionary at each level. The first resource of the appropriate type that it finds is what is used. Most basic questions like this can be resolved with a simple google search (or bing, if that’s your preference).
See here for more information: msdn. Specifically the lookup behavior for static resource section.