如何在 wpf 数据网格标题中显示自定义排序方向图像?
我在我的数据网格中使用这种风格。如何为升序和降序排序方向添加图像?
<Style x:Key="DataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}" >
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#fbfdfc" Offset="0.1" />
<GradientStop Color="#d4d5d9" Offset="0.9" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Padding" Value="3"/>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="SortDirection" Value="{x:Null}" />
</MultiTrigger.Conditions>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#ffd8a8" Offset="0.0" />
<GradientStop Color="#ffad41" Offset="0.5" />
<GradientStop Color="#fedf78" Offset="0.9" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="BorderBrush" Value="Black" />
</MultiTrigger>
</Style.Triggers>
</Style>