Trying a pretty straight-forward thing in AXAML.
The the background color changes on hover, but not on pressed.
I've tried setting IsHitTestVisible of the enclosed label to true and Background of the label to Transparent and {x:Null} in an effort to prevent it from intercepting the click, but that didn't change anything.
I also tried changing the order of the styles so that pressed comes before hover.
<Grid Width="300" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.Styles>
<Style Selector="Grid">
<Setter Property="Background" Value="DarkSlateGray"/>
</Style>
<Style Selector="Grid:pointerover">
<Setter Property="Background" Value="Red"/>
</Style>
<Style Selector="Grid:pointerpressed">
<Setter Property="Background" Value="MediumPurple"/>
</Style>
</Grid.Styles>
<Label Content="TEST" Foreground="White" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744742917a4591134.html
评论列表(0条)