【发布时间】:2010-04-16 22:15:33
【问题描述】:
我在列表框中有一个组合框列表,如下所示:
<ListBox ItemsSource="{Binding Values}">
<ListBox.ItemTemplate>
<DataTemplate>
<ComboBox ItemsSource="{...}" IsTextSearchEnabled="True" IsEditable="True"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
我的列表框 ItemsSouce 的值在我的 ViewModel 中定义为
public ObservableCollection<string> Values { get; set; }
如何获取每个组合框的文本以显示该特定列表框项的值?
(即如果值是 {"a", "b", "c"} 我想要一个显示 "a"、"b" 和 "c" 的 3 个组合框的列表)
【问题讨论】: