Cast LINQ result to ObservableCollection

后端 未结 6 1195
死守一世寂寞
死守一世寂寞 2020-11-29 23:55

The fact that it is a LINQ result might perhaps not be relevant for the question, but I\'m mentioning it anyway - since this is the context which has resulted in this questi

6条回答
  •  臣服心动
    2020-11-30 00:06

    IEnumerable is only the interface.

    You would need to copy the content from the IEnumerable into the ObservableCollection. You can do this by passing your IEnumerable into the constructor of the ObersvableCollection when you create a new one

提交回复
热议问题