Observable Collection replace item

thewayman picture thewayman · Jul 29, 2011 · Viewed 25.1k times · Source

I have a ObservableCollection, I can add and remove item from the collection. But I can't replace an existing item in the collection. There is a way to replace an item and reflect that on my bound components.

System.Collections.Specialized.NotifyCollectionChangedAction.Replace

Can anyone please show me how to accomplish this?

Answer

SLaks picture SLaks · Jul 29, 2011
collection[someIndex] = newItem;