NotifyCollectionChangedEventArgs Constructor (NotifyCollectionChangedAction, Object, Object, Int32)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Initializes a new instance of the NotifyCollectionChangedEventArgs class that describes a Replace change.
Assembly: System (in System.dll)
public NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction action, Object newItem, Object oldItem, int index )
Parameters
- action
- Type: System.Collections.Specialized.NotifyCollectionChangedAction
The action value, as a value of the enumeration. This should be Replace; see Remarks.
- newItem
- Type: System.Object
The new item that is replacing the original item.
- oldItem
- Type: System.Object
The original item that is replaced.
- index
- Type: System.Int32
The index of the item being replaced.
| Exception | Condition |
|---|---|
| NotSupportedException | action is not Replace. |
After construction, NotifyCollectionChangedEventArgs properties are immutable. A Replace action should use this signature because it needs to specify the old and new items. Other actions should use the other signatures.
Show: