Why does the following implicit DataTemplate
not work? Only the commented inline DataTemplate
will work.
Note: If I remove both DataTemplate
s, I see a string representation of the ProductListView
full type name.
<Window.Resources>
<DataTemplate DataType="vm:ProductListViewModel">
<v:ProductListView/>
</DataTemplate>
</Window.Resources>
<TabControl ItemsSource="{Binding Tabs}" TabStripPlacement="Left">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Key}"/>
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<ContentPresenter Content="{Binding Value}">
<!--ContentPresenter.ContentTemplate>
<DataTemplate DataType="vm:ProductListViewModel">
<v:ProductListView/>
</DataTemplate>
</ContentPresenter.ContentTemplate-->
</ContentPresenter>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>