我能够把我的数据来源与显示案文的正文联系起来。 然而,如果检查箱foo<>/strong>的价值得到核实,我就把“Fontlin”设定为黑体。 我试图利用<IMultiValueConverter<>来做到这一点,但迄今没有幸运。 任何关于我做什么错误的想法?
<CheckBox Name="foo"/>
<TextBlock Name="bar" Text="{Binding Path=Name}">
<TextBlock.FontWeight>
<MultiBinding Converter="{StaticResource FontConverter}">
<Binding RelativeSource="{RelativeSource self}" Path="???"/>
<Binding ElementName="???" />
</MultiBinding>
</TextBlock.FontWeight>
</TextBlock>
以及兑换商班(现在总是以黑体返回的硬通布)
Public Class FontConverter
Implements IMultiValueConverter
Public Function Convert(values() As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IMultiValueConverter.Convert
Return "Bold"
End Function
Public Function ConvertBack(value As Object, targetTypes() As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object() Implements System.Windows.Data.IMultiValueConverter.ConvertBack
Return nothing
End Function
End Class