I have a TabControl
<TabControl ItemsSource="{Binding TabItemsViewModelCollection}"
ContentTemplateSelector="{StaticResource TabControlTemplateSelector}"
SelectedItem="{Binding OpenedTab, Mode=TwoWay}" >
<TabControl.ItemTemplate>
<!-- this is the header template-->
<DataTemplate>
<TextBlock
Text="{Binding Header}" />
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
Each tab are rendered with the Header Text and then a close button. (not sure why there are a close button when i only have specified a textblock in the template).
But when i click the close button debugger breaks. How will i handle the clossing of a tab correctly. I have a ObservableCollection with TabViewModels.