views:

269

answers:

1

hi there,

the FrameworkElement's FindResource method allows to get resources defined in this frameworkelement. however, i have some dynamic resources located in another assembly loaded at runtime. Accessing it with DynamicResource from within XAML is no problem, but i wonder how i can get access to Dynamicresources from code (e.g. datatemplateselectors). thanks

+3  A: 

DynamicResource essentially defers the resolution of the resource until runtime, and creates a link between the consumer and the resource so that changes to the resource still propagate to the consumer. It still uses FindResource.

If your external resources are merged into your visual tree you should still be able to find them with FindResource. If not, you can use pack URIs to load them manually.

HTH, Kent

Kent Boogaart