【发布时间】:2016-01-14 02:18:09
【问题描述】:
当鼠标悬停在按钮上时,我正在尝试更改按钮颜色,但它不起作用(按钮仍然是蓝色),我找到的所有示例都像我正在做的那样:
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="#424242"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#8BC34A"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
我做错了什么?
【问题讨论】:
-
你可以尝试使用
<Setter Property="Background.Color" .../> -
如果我使用
Background.Color,它不会被识别为属性