I have a button style hooked to a ResourceDirectory
like so
<Button x:Name="btnPO_Manager" Height="23" Content="PO Manager" Click="Menu_Button" Style="{StaticResource button_Menu}" />
And here is my ResourceDirectory
Style
<Color x:Key="color_BaseFont">Black</Color>
<Color x:Key="color_MajorFont">#d8b243</Color>
<Color x:Key="color_MinorFont">#a01e21</Color>
<Color x:Key="color_MajorBackground">Black</Color>
<Color x:Key="color_MinorBackground">#FF272727</Color>
<SolidColorBrush x:Key="brush_BaseFont" Color="{StaticResource color_BaseFont}"/>
<SolidColorBrush x:Key="brush_MajorFont" Color="{StaticResource color_MajorFont}"/>
<SolidColorBrush x:Key="brush_MinorFont" Color="{StaticResource color_MinorFont}"/>
<SolidColorBrush x:Key="brush_MajorBackground" Color="{StaticResource color_MajorBackground}"/>
<SolidColorBrush x:Key="brush_MinorBackground" Color="{StaticResource color_MinorBackground}"/>
<Style BasedOn="{StaticResource {x:Type Button}}"
TargetType="Button"
x:Key="button_Menu">
<Setter Property="FontSize" Value="10"/>
<Setter Property="Foreground" Value="{StaticResource brush_MajorFont}"/>
<Setter Property="Background" Value="{StaticResource brush_MinorBackground}"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{StaticResource brush_MinorFont}"/>
<Setter Property="Background" Value="{StaticResource brush_MajorBackground}"/>
</Trigger>
</Style.Triggers>
</Style>
This all works great except the triggers background property. the foreground changes on mouse over but the background stays the default blue/gray color.
I tried moving my default colors to the IsMouseOver = False
but ended with the same results. Everything working except the mouseover background.
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{StaticResource brush_MinorFont}"/>
<Setter Property="Background" Value="{StaticResource brush_MajorBackground}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Foreground" Value="{StaticResource brush_MajorFont}"/>
<Setter Property="Background" Value="{StaticResource brush_MinorBackground}"/>
</Trigger>
</Style.Triggers>
Why does this do this and how can I fix it? Any help would be appreciated.