Udostępnij za pośrednictwem


NotifyCollectionChangedEventArgs Constructor (NotifyCollectionChangedAction, Object, Object, Int32)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new instance of the NotifyCollectionChangedEventArgs class that describes a Replace change.

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

Syntax

'Declaration
Public Sub New ( _
    action As NotifyCollectionChangedAction, _
    newItem As Object, _
    oldItem As Object, _
    index As Integer _
)
public NotifyCollectionChangedEventArgs(
    NotifyCollectionChangedAction action,
    Object newItem,
    Object oldItem,
    int index
)

Parameters

  • 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.

Exceptions

Exception Condition
NotSupportedException

action is not Replace.

Remarks

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.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.