Rob*_*ben 3 wpf datagrid wpf-controls wpfdatagrid
这适用于DataGridRow ..
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{StaticResource RolloverBrush}" />
<Setter Property="Foreground" Value="#000" />
</Trigger>
Run Code Online (Sandbox Code Playgroud)
但是当我添加这些时,鼠标悬停样式不起作用..
<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>
Run Code Online (Sandbox Code Playgroud)
风格的顺序很重要.
在其他人工作之前应用交替触发器.
<Style.Triggers>
<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>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{StaticResource RolloverBrush}" />
<Setter Property="Foreground" Value="#000" />
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" Value="{StaticResource SelectedBrush}" />
<Setter Property="Foreground" Value="#000" />
</Trigger>
</Style.Triggers>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2377 次 |
最近记录: |