Transactional support in a monitored collection

I am interested in the most efficient way to change the observed collection in such a way that only one property is changed. Suppose I want to populate a list with three elements, there is no addCollection method or something like that, so I have to add clear + 3 times. Do I need to create another observable collection and assign? Or what techniques do others use?

+3
source share
1 answer

The NET Framework class ObservableCollectionsends separate notifications as each item added to the collection and does not provide a mechanism for functions like AddRange. However, you can easily create your own collection that implements INotifyCollectionChangedand sends any notifications that you like.

, INotifyCollectionChanged , , NET Framework . - , , , "". NET Framework , .

, , , Reset AddRange . , Reset .

, , ObservableCollection . , Add(), CollectionViews . , , . .

+2

Source: https://habr.com/ru/post/1732571/


All Articles