admin管理员组文章数量:1391934
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>
本文标签: cAvalonia UI AXAML styling issue for selector pointerpressedStack Overflow
版权声明:本文标题:c# - Avalonia UI AXAML styling issue for selector :pointerpressed - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744742917a2622715.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论