2

我有一个TextBlock并且我有一个MultiDataTrigger定义为,如果两个属性都为假,那么我希望TextBlock移动到另一个网格列。问题是整个风格根本不起作用。它甚至没有将默认的 Grid.Column 设置为 5。请帮忙。对帖子进行编辑,前两个文本块被折叠并正确显示

                <TextBlock
                    Name="PlateBarcodeTextBlock"
                    Grid.Column="3"
                    Text="{Binding Barcode}" 
                    Visibility="{Binding ShowBarCodeForPlate,
                                 Converter={StaticResource boolToVisibility}}" />
                <!--Plate Size-->
                <TextBlock
                    Name="PlateSizeTextBlock"
                    Grid.Column="4"
                    Style="{StaticResource PlateSizeDisplayStyle}" 
                    Visibility="{Binding ShowSelectedPlateSize,
                                 Converter={StaticResource boolToVisibility}}"/>

    <TextBlock
        Name="ProtocolNameTextBlock"
        Text="{Binding ProtocolName}" >
        <TextBlock.Style>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="Grid.Column" Value="5"></Setter>
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShowBarCodeForPlate}"
                                       Value="False"/>
                            <Condition Binding="{Binding ShowSelectedPlateSize}"
                                       Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Grid.Column" Value="3"></Setter>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>
        </TextBlock.Style>
    </TextBlock>
4

0 回答 0