Wpf:数据触发器无法正常工作

时间:2018-04-11 05:19:00

标签: c# wpf visual-studio xaml datatrigger

这是我的代码,请告诉我为什么它对我不起作用..

<Label Grid.Column="0" Margin="10 0 0 0" Background="{DynamicResource Info}" HorizontalContentAlignment="Center" FontWeight="Bold" Foreground="White" Name="lblOrderType" Content="{Binding ordertype}" FontSize="15">
    <Label.Style>
        <Style TargetType="Label">
            <Style.Triggers>
                <DataTrigger Binding="{Binding ordertype}" Value="Delivery">
                    <Setter Property="Background" Value="Salmon"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Label.Style>
</Label>

0 个答案:

没有答案