使用WPF数据网格,我需要遵守这些要求:
到目前为止我无法满足最后一个条件。我现在的代码是:
<Style x:Key="GridRow" TargetType="DataGridRow">
<Setter Property="FontSize" Value="10" />
<Setter Property="Foreground" Value="#000000" />
<Setter Property="Background" Value="#E5E5E5" />
<Setter Property="Height" Value="24" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#F5F5F5" />
</Trigger>
<DataTrigger Binding="{Binding IsStatusCritical}" Value="True">
<Setter Property="Background" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type DataGridCell}">
<Style.Triggers>
<Trigger Property="DataGridCell.IsSelected" Value="True">
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#660066" />
</Trigger>
</Style.Triggers>
</Style>