23
我有下面的邊框。爲什麼我的TextBlock正常工作的前景,但在邊框的背景始終保持不變(如果物業請將isDeleted始終是假的)邊框背景上的Style.DataTrigger
<Border DockPanel.Dock="Top" BorderBrush="Black" Background="#CBE2FF" BorderThickness="2" CornerRadius="5" Padding="0" Margin="5">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsDeleted}" Value="True">
<Setter Property="Background" Value="#A00000"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Margin="5" FontWeight="Bold" FontSize="14" Text="Queue Details">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsDeleted}" Value="True">
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Border>
完美。我不知道我是否把它放在了財產上,它是否超越了它。謝謝 – Miles 2010-07-30 17:25:46