In the documentation of the event args of NotifyCollectionChangedEventArgs, there is an action called Replace (in addition to Add, Remove, Move, etc.). When can this be fired? I can't see any Replace method in ObservableCollection
How can an ObservableCollection fire a Replace action?
Asked Answered
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 (i.e. Set)
© 2022 - 2024 — McMap. All rights reserved.