How can an ObservableCollection activate a Replace action?

In the args NotificationCollectionChangedEventArgs event documentation, there is an action called Replace (in addition to Add, Remove, Move, etc.). When can this be fired? I don't see any Replace method in ObservableCollection

+6
source share
1 answer

Here is an example:

ObservableCollection<string> myCollection = new ObservableCollection<string>; myCollection.Add("One"); myCollection.Add("Two"); myCollection.Add("Three"); myCollection.Add("Four"); myCollection.Add("Five"); myCollection[4] = "Six"; // Replace (ie Set) 
+8
source

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


All Articles