I know there a lot of topics related to this question but I could not find a solution that fits perfectly for my problem ... maybe there is none?
At the moment I have a UserControl
which holds a navigation which allows the user to switch between different screens. These screens are defined in the Resources
part of my UserControl
as DataTemplate
.
Something like that:
<DataTemplate TargetType={x:Type vm:ViewModel1}>
...
</DataTemplate>
<DataTemplate TargetType={x:Type vm:ViewModel2}>
...
</DataTemplate>
<DataTemplate TargetType={x:Type vm:ViewModel3}>
...
</DataTemplate>
Ok and what I wanna do is to place these DataTemplates in a separate XAML file and link this file to the UserControl's resources part. Do I really have to make this new XAML Resource Dictionary globally available in my application (adding it to the App.xaml resources) or is there another/better way?