【发布时间】:2013-02-13 11:21:31
【问题描述】:
I send the selected items to a specific command when the selection changes (each item is a class X)
我将它们作为对象,如何将其转换为列表?
我试过了:
1. IList<x> SelectedItemsList = obj as ObservableCollection<x>;
2. IList<x> SelectedItemsList = obj as IList<x>;
3. List<x> SelectedItemsList = obj as List<x>;
它没有帮助。
这种类型的列表:System.Windows.Controls.SelectedItemCollection我想将它转换为我的列表:ObservableCollection<x>/IList<x>/List<x>(ViewModel 无法识别 wpf 的控件列表)
【问题讨论】:
标签: wpf mvvm datagrid selecteditem