0
我有这样的模式:如何绑定到Model对象列表中的某个属性?
public class Device {
public string Name { get; set; }
public SomeOtherType SomeOtherStuff { get; set; }
}
而且这个名单:
ObservableCollection<Device> DevicesCollection { get; set; }
这是我从不时改变。
我还使用自定义UserControl
我做了,是这样的:
<my:MyCustomListControl ItemsSource="{what goes here???}" />
此控件的使用应该显示所有Device
s的列表,但只有他们Name
财产。
那么如何将ItemsSource
仅绑定到集合的Name
属性?
看看这个问题http://stackoverflow.com/questions/5409259/binding-itemssource-of-a-comboboxcolumn-in-wpf-datagrid – Ehsan