0
作爲WPF的相對新手,我很努力地看到爲什麼我在以下場景中遇到綁定錯誤。MultiBinding Converter上的綁定錯誤
我有以下XAML
<TextBlock.Text>
<MultiBinding Converter="{StaticResource CardinalityConverter}">
<Binding/>
<Binding Path="ed.Min" />
<Binding Path="ed.Max" />
</MultiBinding>
</TextBlock.Text>
的綁定錯誤我得到的是如下
System.Windows.Data Warning: 40 : BindingExpression path error: 'ed' property not found on 'object' ''SDNode' (HashCode=2343823)'. BindingExpression:Path=ed.Min; DataItem='SDNode' (HashCode=2343823); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
System.Windows.Data Warning: 40 : BindingExpression path error: 'ed' property not found on 'object' ''SDNode' (HashCode=2343823)'. BindingExpression:Path=ed.Max; DataItem='SDNode' (HashCode=2343823); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
如果我把一個斷點在「CardinalityConverter」則看到下面,你可以看到值(1)和值(2)未設置。
如果我擴大值(0),那麼以下是看到
'編' 是清楚地看到,爲什麼不綁定不認識到這一點?