Yes, this is confusing ...
According to this blog post , it looks like this is an omission from WPF.
To do this, you need to use a style:
<Border Name="ClearButtonBorder" Grid.Column="1" CornerRadius="0,3,3,0"> <Border.Style> <Style> <Setter Property="Border.Background" Value="Blue"/> <Style.Triggers> <Trigger Property="Border.IsMouseOver" Value="True"> <Setter Property="Border.Background" Value="Green" /> </Trigger> </Style.Triggers> </Style> </Border.Style> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="X" /> </Border>
I guess this problem is not so common, as most people tend to take this thing into style, so it can be used for several controls.
Grokys Mar 05 '10 at 17:14 2010-03-05 17:14
source share