You could simply nest each base class UserControl
inside more derived UserControl
s, but you could find that this might soon become unmanageable. Another way would be to use the ContentControl
element to display sections of larger DataTemplate
s from other DataTemplate
s like this:
<DataTemplate x:Key="NameTemplate" DataType="{x:Type ViewModels:UserViewModel}">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
...
<DataTemplate DataType="{x:Type ViewModels:UserDerivedViewModel}">
<ContentControl Content="{Binding}"
ContentTemplate="{StaticResource NameTemplate}" />
<TextBlock Text="{Binding Age}" />
</DataTemplate>