I've got a TabControl with several TabItems. I'm trying to make them have a flatter design. The idea is to have the outside border of the tab go away, with the active tab indicated by a green line at the bottom of the tab. I've been able to get the green line to work perfectly, but no matter what I do I can't get rid of the left, top, and right lines of each TabItem.
Due to text formatting constraints in my specs, I have wrapped the TabItem header into a TextBlock wrapped by a Border. I suspect this combination may have something to do with it. If there is a way to show the green bottom border on the active tab, while allowing line breaks (each tab has two words that need to be split into two lines) and text centering in the tab header, I am totally fine with changing my configuration. I've tried various combinations of the BorderThickness, Margin, and Padding properties to no avail.
<TabControl HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch" x:Name="tabControl">
<TabItem MaxWidth="55" HorizontalAlignment="Center" Background="White">
<TabItem.Header>
<Border Style="{StaticResource TabItemText}">
<TextBlock TextAlignment="Center" Text="Actions Needed" TextWrapping="Wrap"></TextBlock>
</Border>
</TabItem.Header>
</TabItem>
</TabControl>
This is the tab coloring code. It does some redundant things at the moment, but it illustrates what I'm trying to do.
<Style x:Key="TabItemText" TargetType="{x:Type Border}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=TabItem}}" Value="True">
<Setter Property="BorderBrush" Value="#57B481"/>
<Setter Property="BorderThickness" Value="0 0 0 4"/>
<Setter Property="Margin" Value="0 0 0 -3"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=TabItem}}" Value="False">
<Setter Property="BorderThickness" Value="0 0 0 0"/>
<Setter Property="Margin" Value="0 0 0 -3"/>
</DataTrigger>
</Style.Triggers>
</Style>