这对于DataGridRow来说非常有效。
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{StaticResource RolloverBrush}" />
<Setter Property="Foreground" Value="#000" />
</Trigger>
但是当我添加这些内容后,鼠标悬停样式不起作用了。
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="{StaticResource LightRowBrush0}" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource LightRowBrush1}" />
</Trigger>
<Style TargetType="DataGrid" BasedOn="{StaticResource {x:Type DataGrid}}"> <Setter Property="AlternatingRowBackground" Value="#FF282828"/> </Style>
- Abin