I am trying to set the background color to a tabItemEx when it is selected or MouseOver using below style.
<Style x:Key="tabTabItem" TargetType="{x:Type TabItem}"> <Setter Property="Background" Value="#FFE1E1E1" > </Setter> <Setter Property="Foreground" Value="#FF000000"></Setter> <Setter Property="Margin" Value="2,0,2,0"></Setter> <Setter Property="VerticalAlignment" Value="Stretch"/> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="#FFFFFFFF"></Setter> </Trigger> <Trigger Property="IsSelected" Value="True"> <Setter Property="Foreground" Value="#FFFFFFFF"></Setter> <Setter Property="FontFamily" Value="Arial"/> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#FFB14D71" Offset="0.125"/> <GradientStop Color="#FF913E5C" Offset="0.789"/> </LinearGradientBrush> </Setter.Value>
But it is not setting any color. it is displaying default color only.
Am i doing ny thing wrong? Please suggest me the correct way.
</Setter> </Trigger> </Style.Triggers> </Style>
Hello,
Actually, the style has to target the TabItemEx rather than the TabItem element, like this:
<Style TargetType="{x:Type igWindows:TabItemEx}">
and it should be working.
No Alex,
Even after changing that also it is not changing the background.
It is displaying default color ( white) only.