I'm creating a specific style for some TabControl in my application.
<TabControl Style="{StaticResource MyTabControl}">
</TabControl>
I want to also style TabItem in the case of this specific TabControl's Style.
For now, I must write :
<TabControl Style="{StaticResource MyTabControl}">
<TabItem Style="{StaticResource MyTabItem}" Header="First" />
<TabItem Style="{StaticResource MyTabItem}" Header="Second" />
</TabControl>
Instead of having to specify the "MyTabItem" style on each TabItem, is there any way to set the default TabItem style only in the scope of a specific TabControl Style ?
I didn't found a way to specify, in the style of my TabControl, which style should be applied on all children TabItems.
<TabControl ItemContainerStyle="{StaticResource MyTabItem}"/>
put style for target type TabItem as a implicit style under your MyTabItem style resource
<Style TargetType="TabControl" x:Key="TabControlStyle">
<Style.Resources>
<Style TargetType="TabItem">
</Style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With