【发布时间】:2014-12-22 10:39:47
【问题描述】:
当与列表框中的一项交互时,它很简单:
myClass citem = (myClass)myListBop.SelectedItem.
viewModel.doSomethingWithItem(cItem)
多个项目的正确方法是什么?我已经看到了简单地将数据复制到列表的示例,但是肯定最好避免复制并进行正确的演员表吗? Resharper 好心地告诉我,我可能做错了什么:
建议在哪里:
Suspicious case: there is no type in the solution which is inherited from both "Sytem.Windows.Forms.ListBox.SelectedObjectCollection" and "System,Collections.Generic.IList<myClass>"
基本上 IList / SelectedObjectCollection 的预期用途是什么?
【问题讨论】:
-
ListBox.SelectedObjectCollection和
IList<MyClass>之间没有关系,它们都以IList为基类