3
我刚开始学习WPFand MVVM.Here的选择项更新文本框是我想做的事:TreeView控件(MVVM):从树
使用时选择树中的任何节点,该节点的描述显示在文本框。 这里是XMAL(这是在为组合框不是树状)
<Grid Margin="0,0,0,33" Name="grid1">
<TreeView HorizontalAlignment="Left"
Margin="24,47,0,6"
Name="treeView1"
Width="120"
ItemsSource="{Binding Path=.}">
</TreeView>
<TextBox
Margin="150,47,24,61"
Name="textBox1"
Text="{Binding Path=CurrentItem.Description}"
/>
</Grid>
什么是CurrentItem?属性在ViewModel ..... – ethicallogics 2012-07-13 04:51:15
@ethicallogics正如我所说,我从复选框的一些例子复制片段。说明是属性。 Text =“{Binding Path = Description}” 但是,当我选择nodes.it时保持不变。所以我希望它改变,当我选择其他节点 – Satbir 2012-07-13 04:59:01