Why does ObservableCollection not support bulk changes?

前端 未结 4 1469
挽巷
挽巷 2021-01-11 14:48

What are the potential problems caused by an ObservableCollection supporting operations like AddRange or RemoveRange? There must be a

4条回答
  •  醉梦人生
    2021-01-11 15:13

    NotifyCollectionChangedEventArgs includes index information. Removing items causes indexes to reshuffle, as does inserting items. Hence, whilst not entirely impossible, it would be rather difficult and probably inefficient to provide the ability to work with ranges.

提交回复
热议问题