WPF 将类实例的字段绑定到数据触发器

问题描述 投票:0回答:1

我有带有下一个字段的 PivotGridControl

<dxpg:PivotGridControl.Fields>
    <dxpg:PivotGridField FieldName="CourierFullName" 
                         Area="RowArea"
                         Caption="Courier"/>
    <dxpg:PivotGridField FieldName="Header" 
                         Area="ColumnArea"
                         Caption="Data" 
                         ValueFormat="yyyy-MM-dd" SortOrder=
                         "Descending"/>
    <dxpg:PivotGridField Area="DataArea" 
                         SummaryType="Min"
                         CellTemplate="{StaticResource CellTemplate}"/>
</dxpg:PivotGridControl.Fields>

班级提供的填写信息

public class CourierFlattenRow
{
    public DateTime Header { get; set; }
    public string CourierFullName { get; set; }
    public TariffZone TariffZone { get; set; }
    public DeliveryTerm DeliveryTerm { get; set; } 
    public CourierExtraEvent ExtraEvent { get; set; }
}

如果字段 ExtraEvent.IsWorkingDay == true,如何设置绘制单元格的数据触发器?

c# wpf devexpress
1个回答
0
投票
<DataTrigger Binding="{Binding ExtraEvent.IsWorkingDay}" Value="True">   <!--
    Define global resources and styles here, that apply to all pages in your app.
-->
     <Setter Property="Visibility" Value="Hidden"/>
</DataTrigger>

如果我理解正确的话,您希望在 ExtraEvent.IsWorkingDay 为 True 时显示一个项目,否则不显示。

© www.soinside.com 2019 - 2024. All rights reserved.