I'm currently trying to style the ToggleButton in the Expander control
but I can't figure out how to change it's Background
color and the Foreground
color.
I've currently managed to change the Text
in the border but I can seem to find how to target the ToggleButton, is it under some other name?
This is what I've got so far.
<Style TargetType="Border" x:Key="RacePitBorderStyle" >
<Setter Property="Background" Value="{StaticResource BackBrush}"/>
</Style>
<DataTemplate x:Key="titleText">
<Border Style="{StaticResource RacePitBorderStyle}" Height="24">
<TextBlock Text="{Binding}"
Margin="75,0,0,0"
VerticalAlignment="Center"
Foreground="White"
FontSize="11"
FontWeight="Medium"
Width="{Binding
RelativeSource={RelativeSource
Mode=FindAncestor,
AncestorType={x:Type Expander}},
Path=ActualWidth}"/>
</Border>
</DataTemplate>
<Style TargetType="{x:Type Expander}">
<Setter Property="HeaderTemplate" Value="{StaticResource titleText}"/>
</Style>