In my WPF document I have this:
<Window.Resources>
<Style x:Key="SidebarTab" TargetType="TabItem">
<Setter Property="Foreground" Value="#303030"></Setter>
<Setter Property="BorderBrush" Value="Transparent"></Setter>
<Setter Property="BorderThickness" Value="0"></Setter>
<Setter Property="Background" Value="#151515"></Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="{StaticResource PrimaryHueMidBrush}"></Setter>
<Setter Property="BorderBrush" Value="Transparent"></Setter>
<Setter Property="BorderThickness" Value="0"></Setter>
<Setter Property="Background" Value="#151515"></Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Border Background="#151515" CornerRadius="20">
<Grid Margin="23,47,0,0">
<TabControl TabStripPlacement="Left" Style="{DynamicResource SidebarTabControl}">
<TabItem Style="{DynamicResource SidebarTab}">
<TabItem.Header>
<materialDesign:PackIcon Kind="EmoticonLol" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</TabItem.Header>
</TabItem>
<TabItem Style="{DynamicResource SidebarTab}">
<TabItem.Header>
<materialDesign:PackIcon Kind="EmoticonLol" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</TabItem.Header>
</TabItem>
<TabItem Style="{DynamicResource SidebarTab}">
<TabItem.Header>
<materialDesign:PackIcon Kind="EmoticonLol" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</TabItem.Header>
</TabItem>
<TabItem Style="{DynamicResource SidebarTab}">
<TabItem.Header>
<materialDesign:PackIcon Kind="EmoticonLol" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</TabItem.Header>
</TabItem>
<TabItem Style="{DynamicResource SidebarTab}">
<TabItem.Header>
<materialDesign:PackIcon Kind="EmoticonLol" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</TabItem.Header>
</TabItem>
</TabControl>
</Grid>
</Border>
And it looks like this:
I get the desired effect of the icon changing color on the TabItem
, but the Background
and BorderBrush
(as well as BorderThickness
) are still being changed to kind of "link up" to the content inside the header and this is what I want to remove:
I added the things inside the style like so:
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="{StaticResource PrimaryHueMidBrush}"></Setter>
<Setter Property="BorderBrush" Value="Transparent"></Setter>
<Setter Property="BorderThickness" Value="0"></Setter>
<Setter Property="Background" Value="#151515"></Setter>
</Trigger>
</Style.Triggers>
But it still doesn't work. Does anyone have any suggestions on how to do this?