Why is button background defaulting to grey when IsPressed is true
- by Dave Colwell
Hey all,
I have a simple problem. Using the IsPressed trigger i want to be able to set the background color of a button to something other than the default grey. Here is what the button looks like when it is not pressed
and here is what it looks like when it is clicked
Here is the trigger for the button. I know the trigger is firing correctly because of the glow effect around the edge of the button when it is clicked. I also know that the brush is correct because i tried it out as a background brush to see what it looked like.
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHoverBrush}"/>
<Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/>
</Trigger>
<!-- This is the trigger which is working but the background color wont change -->
<Trigger Property="IsPressed" Value="True">
<Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/>
<Setter Property="Background" Value="{DynamicResource ButtonPressedBrush}" />
</Trigger>
</Style.Triggers>