The Button class only contains one Dependency Property (DP) for Background, there is no DP for IsMouseOver background.
You have multiple choices, here's a few :
1) Create an Attached Property named IsMouseOverBackground of type Brush and bind to it in your Style.
C#
namespace WpfApp1
{
public class ButtonHelper
{
public static readonly DependencyProperty IsMouseOverBackgroundProperty =
DependencyProperty.RegisterAttached("IsMouseOverBackground", typeof(Brush), typeof(ButtonHelper), new PropertyMetadata(null));
public static Brush GetIsMouseOverBackground(DependencyObject obj)
{
return (Brush)obj.GetValue(IsMouseOverBackgroundProperty);
}
public static void SetIsMouseOverBackground(DependencyObject obj, Brush value)
{
obj.SetValue(IsMouseOverBackgroundProperty, value);
}
}
}
XAML
Note the use of parentheses in the Binding, that is needed when binding to an Attached Property.
2) Create a IsMouseOverButton class that inherits from Button, add a DP called IsMouseOverBackground of type Brush and bind to it in your Style.
C#
namespace WpfApp1
{
public class IsMouseOverButton : Button
{
public static readonly DependencyProperty IsMouseOverBackgroundProperty =
DependencyProperty.Register("IsMouseOverBackground", typeof(Brush), typeof(IsMouseOverButton), new PropertyMetadata(null));
public Brush IsMouseOverBackground
{
get { return (Brush)GetValue(IsMouseOverBackgroundProperty); }
set { SetValue(IsMouseOverBackgroundProperty, value); }
}
}
}
XAML