By default, any button changes its background color to a slightly darker tint whenever a mouse pointer is over it, but with the following custom style, the background color does not change when a pointer is over the button, and I can't find any properties that allow me to control that.
Code: Select all
<Style
TargetType="Button"
x:Key="largeButton">
<Setter Property="Padding" Value="10,5,15,5" />
<Setter Property="Margin" Value="0,10,10,0" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Background" Value="#6CC04A" />
<Setter
Property="Template">
<Setter.Value>
<ControlTemplate
TargetType="Button">
<Border
CornerRadius="32"
Background="{TemplateBinding Background}">
<ContentPresenter
FontSize="22"
Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>