我有一个绑定到过滤的 DataView 的按钮(总是 1 条记录):
<Button x:Name="btnValidate" Grid.Row="0" Grid.RowSpan="2" Grid.Column="3" Cursor="Hand" Click="btnValidate_Click">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="{StaticResource ValidationNoneBrush}" />
<Setter Property="Tag" Value="{Binding VALIDATED, Converter={StaticResource DebugConverter}}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border x:Name="bdrValidate" Background="{TemplateBinding Background}">
<Image Source="../Images/24/LocationSearch.png" Stretch="None" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Tag" Value="1">
<Setter Property="Background" Value="Blue"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
如您所见,我有一个用于调试的转换器,它工作正常。我看到通过转换器的值是 0 和 1。那么为什么背景没有根据 Style Trigger 而改变呢?我想不通...