.FindResource within DataTemplateSelector.SelectTemplate(...)

Topics: Prism v1, Prism v2 - WPF 3.5
May 19, 2009 at 6:25 PM

Hi all,

I wrote an own implementation of DataTemplateSelector. Within SelectTemplate.(...) I need to access datatemplates defined within xaml (of course).

Problem: the templates are defined within a views xaml. Application.Current.FindResource(...) cannot find the template. How to lead .FindResource(...) to the appropriate template?

Another approach via setting the templates within xaml to public properties will not be an option. It leads actually to unresolvable circular references with Resource-Section. Thats why I need to find the templates within .SelectTemplate(...).

Thanks for any hint.