NotifyCollectionChangedEventArgs Constructor (NotifyCollectionChangedAction, Object, Int32)

NotifyCollectionChangedEventArgs Constructor (NotifyCollectionChangedAction, 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 an Add or Remove change.

Namespace:  System.Collections.Specialized
Assembly:  System (in System.dll)

public NotifyCollectionChangedEventArgs(
	NotifyCollectionChangedAction action,
	Object changedItem,
	int index
)

Parameters

action
Type: System.Collections.Specialized.NotifyCollectionChangedAction
The action value, as a value of the enumeration. This should be Add or Remove; see Remarks.
changedItem
Type: System.Object
The item that is affected by the change.
index
Type: System.Int32
The index where the change occurred.

ExceptionCondition
NotSupportedException

action is not Add or Remove.

Add or Remove are the only valid actions that can be passed to this constructor signature. After construction, NotifyCollectionChangedEventArgs properties are immutable. A Reset action should use the NotifyCollectionChangedEventArgs signature, and a Replace action should use the NotifyCollectionChangedEventArgs signature because it needs to specify the old and new items.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft