0
为什么绑定到ValueTuple
属性成员(如Item1,Item2等)不工作?ValueTuple与WPF绑定
<TextBlock x:Name="txtTest" Text="{Binding Item1}" />
代码:
txtTest.DataContext = ("Item A", "Another Item..");
输出窗口:
BindingExpression path error: 'Item1' property not found on 'object' ''ValueTuple`2'
但是在Tuple
它总是奏效。
'this.DataContext = new Tuple(“item 1”,“item 2”);'这工作正常。 –
AnjumSKhan
@AnjumSKhan对。我已经在我的问题中提到过了。 – dovid