最佳答案
I want the border to turn green when the mouse is over it and then to return to blue when the mouse is no longer over the border.
I attempted this without any luck:
<Border
Name="ClearButtonBorder"
Grid.Column="1"
CornerRadius="0,3,3,0"
Background="Blue">
<Border.Triggers>
<Trigger Property="Border.IsMouseOver" Value="True">
<Setter Property="Border.Background" Value="Green" />
</Trigger>
<Trigger Property="Border.IsMouseOver" Value="False">
<Setter Property="Border.Background" Value="Blue" />
</Trigger>
</Border.Triggers>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="X" />
</Border>
How can one set a trigger or events for MouseOver?