我正在调整Opacity
中自定义控件项的ListView
,并希望将它们设置回完全不透明度OnMouseOver
。我可以将它们调暗OnMouseOver
,但我无法增加Opacity
。我猜这与ListView
ControlTemplate有关。任何帮助表示感到非常沮丧:
<ListView Background="Transparent" BorderBrush="Transparent" Grid.Row="0" VerticalAlignment="Top">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9"/>
</Trigger>
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
<notify:NotificationInfo/>
</ListView>
答案 0 :(得分:0)
我不知道这是否有用:
<ListView>
<ListViewItem>Johan</ListViewItem>
<ListViewItem>Ray</ListViewItem>
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Opacity" Value=".2"/>
</Trigger>
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
</ListView>
感觉不太好。