In my application, I have a tab control that has several tabs. The problem is that I want to apply style to these tabs, but not to any other (nested) tabs.
I tried to set the following style in the tab control, but this also affects all children:
<Style x:Key="tabControlStyle" TargetType="{x:Type TabControl}"> <Setter Property="TabItem.Template" Value="{StaticResource tabItemTemplate}" /> </Style>
Using the code above, I get the following error: "TabItem" ControlTemplate TargetType does not match a "TabControl" template, because TabItem and TabControl have the same DependencyProperty "Template" and the code tries to set TabItemTemplate as a TabControl - Template.
Can someone help me?
source share