Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How do I effect the style of the TabItem header, only?

$
0
0

I'm trying to style a TabItem, and setting control template triggers so that when the IsSelected is true, then the text in the header of the TabItem is bold, and it isn't otherwise. I can set that property fine, but I've found that it's being applied to all of the content of the tab, not just the TabItem header. Here's what I've got:

<TabControl.Resources><Style TargetType="TabItem"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type TabItem}"><Grid><Border Name="TabItemBorder" Margin="0,0,-4,0" BorderThickness="1,1,1,1" CornerRadius="2,2,0,0"><ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center"
								  ContentSource="Header" Margin="12,2" RecognizesAccessKey="True" /></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsSelected" Value="True"><Setter Property="FontWeight" Value="Bold" /></Trigger></ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter></Style></TabControl.Resources>

What am I doing wrong?

Rod


Viewing all articles
Browse latest Browse all 18858

Trending Articles