在NotifyCollectionChangedEventArgs的事件args的文档中,有一个名为Replace的
action(除了Add,Remove,Move等).什么时候可以解雇?我在ObservableCollection中看不到任何Replace方法
解决方法
这是一个例子:
- 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)