I am just getting into WPF. I have two event handlers:
private void Mouse_Enter(object sender, MouseEventArgs e)
{
((Button)sender).Background = Brushes.Red;
}
private void Mouse_Leave(object sender, MouseEventArgs e)
{
((Button)sender).Background = Brushes.Black;
}
When the mouse enters the button's area, nothing happens. However, when leaving the button's area, the button does go black. I have put a breakpoint inside Mouse_Enter
and it is definitely executing the method, just doesn't change the background color.
How to fix it? Thanks!