我正在尝试编写一个使用DataGridRow背景色作为条件的MultiDataTrigger。数据网格具有交替的颜色,因此基础颜色为白色,交替的颜色为雾蓝色。我想做的就是像这个例子一样,基于item属性和当前datagridrow更改datagridrow的颜色。
我将不胜感激
<MultiDataTrigger
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding StatusCodeID, Converter={StaticResource FTrim}}" Value="C" />
<Condition Binding {...DatagridRow.BackGround}" Value="White" />
</MultiDataTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource Color_Complete_Orders_Base_Row}" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding StatusCodeID, Converter={StaticResource FTrim}}" Value="C" />
<Condition Binding {...DatagridRow.BackGround}" Value="MistyBlue" />
</MultiDataTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource Color_Complete_Orders_Alt_Row}" />
</MultiDataTrigger>"
转换器只是将字符串StatusCodeID从“ A”修剪为A。