WPF TabControl and DataTemplates
问题 I've got a set of ViewModels that I'm binding to the ItemsSource property of a TabControl. Let's call those ViewModels AViewModel, BViewModel, and CViewModel. Each one of those needs to have a different ItemTemplate (for the header; because they each need to show a different icon) and a different ContentTemplate (because they have very different interaction models). What I'd like is something like this: Defined in Resource.xaml files somewhere: <DataTemplate x:Key="ItemTemplate" DataType="{x