Why is the following implicit DataTemplate not working? Only a commented inline DataTemplate will work.
Note. If I delete both DataTemplate s, I see a string representation of the fully ProductListView name of the ProductListView type.
<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> </DataTemplate> </TabControl.ContentTemplate> </TabControl>
wpf datatemplate
Shimmy
source share