I am trying to replace the tab headers with a picture and a name. I can replace each header no problem. The issue is I need to change the text color when the tab is selected.
Here is my header content so far:
<igWindows:TabItemEx > <igWindows:TabItemEx.Header> <StackPanel Height="70" Width="70"> <Image Source="..\images\transactions.png" Height="48" Width="48" /> <TextBlock Text="Transactions" HorizontalAlignment="Center" /> </StackPanel> </igWindows:TabItemEx.Header> </igWindows:TabItemEx>
Is there a way to do this as a style or a template and set the triggers to change the text block's foregound color?
<Style TargetType="{x:Type igWindows:TabItemEx}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igWindows:TabItemEx}">
<StackPanel Height="70" Width="70">
<Image Source="{Binding Path=SomePath}" Height="48" Width="48" />
<TextBlock Text="{TemplateBinding Header}" Name="header" HorizontalAlignment="Center" />
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" TargetName="header" Value="Red"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I had to take my theme off of the tab control to get this to work. Is there any way to do this and only affect the header object?
You could use the same approach I recommend here for adding an image to a tab using the HeaderTemplate and just add in a datatrigger based on the IsSelected of the tab item. e.g.
That worked! Thanks for the help.