ObservableCollection : calling OnCollectionChanged with multiple new items

前端 未结 4 1262
[愿得一人]
[愿得一人] 2020-12-06 02:33

please note that I am trying to use NotifyCollectionChangedAction.Add action instead of .Reset. the latter does work, but it is not very efficient with large collections.

4条回答
  •  温柔的废话
    2020-12-06 03:06

    I believe you need to cast it to an IList:

    base.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, (IList)_cachedItems));

提交回复
热议问题