How to convert IEnumerable to ObservableCollection?

前端 未结 5 1935
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 19:34

How to convert IEnumerable to ObservableCollection?

5条回答
  •  攒了一身酷
    2020-11-29 20:14

    As per the MSDN

    var myObservableCollection = new ObservableCollection(myIEnumerable);
    

    This will make a shallow copy of the current IEnumerable and turn it in to a ObservableCollection.

提交回复
热议问题