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 的控件列表)