I'm using following style for buttons in my WPF application. In here how can I set the mouse hover color for a button?
<Style TargetType="{x:Type Button}" x:Key="ButtonStyle2">
<Setter Property="FontSize" Value="16" />
<Setter Property="Background" Value="#FF45414D" />
<Setter Property="Height" Value="35" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border CornerRadius="6,6,6,6" Background="#FF45414D" >
<ContentPresenter x:Name="contentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Then I changed my code as following to add mouse over property. Click here But still it's not working.
<Style TargetType="{x:Type Button}" x:Key="ButtonStyle2">
<Setter Property="FontSize" Value="16" />
<Setter Property="Background" Value="#FF45414D" />
<Setter Property="Height" Value="35" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border CornerRadius="6,6,6,6" Background="#FF45414D" >
<ContentPresenter x:Name="contentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>