I know there is this thread: How to find a resource in a UserControl from a DataTemplateSelector class in WPF?
asking the same.
BUT... I am not satisfied with the answer! THERE MUST be a way to grab the Resources of the
UserControl containing the ContentControl/Presenter declaring this:
ContentTemplateSelector="{StaticResource MySelector}"
Each derived DataTemplateSelector
class a parameter in its SelectedTemplate
Method =>
container which is typeof DependencyObject.
Well container is in my case the contentcontrol.
Would it not be possible to climb up the visual tree starting at "contentcontrol" and try to get the UserControl via FindAncestor ?