I have user HeaderedItemsControl
to display different UserControl
in my application.
Now I declared these UserControl
with DataTemplate
as follows in my MainWindow
.
<HeaderedItemsControl.Resources>
<DataTemplate DataType="{x:Type vm:SearchViewModel}">
<vw:SearchStudentView/>
</DataTemplate>
<DataTemplate DataType="{x:Type vm:SearchViewModel2}">
<vw:SearchStudentView2/>
</DataTemplate>
</HeaderedItemsControl.Resources>
But I have almost 20 view and I want to place all DataTemplate
in ResourceDictionary
.
Can any one help me how can I use these DataTemplate
's from ResourceDictionary
in HeaderedItemsControl
's resources?