NotifyCollectionChangedEventArgs NotifyCollectionChangedEventArgs NotifyCollectionChangedEventArgs Class

Provides the event data for a CollectionChanged event.

.NET This class appears as System.Collections.Specialized.NotifyCollectionChangedEventArgs.

Syntax

Declaration

public class NotifyCollectionChangedEventArgspublic class NotifyCollectionChangedEventArgsPublic Class NotifyCollectionChangedEventArgs

Remarks

When programming with .NET, this class is hidden and developers should use the System.Collections.Specialized.NotifyCollectionChangedEventArgs class.

Constructors summary

Initializes a new instance of the NotifyCollectionChangedEventArgs class.

Properties summary

Gets the description of the action that caused the event.

Gets the items affected by an action.

Gets the index at which the change occurred.

Gets the item affected by a Replace or Remove action.

Gets the starting index at which a Move, Remove, or Replace action occurred.

Constructors

  • NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction, IBindableVector, IBindableVector, Int32, Int32)
    NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction, IBindableVector, IBindableVector, Int32, Int32)
    NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction, IBindableVector, IBindableVector, Int32, Int32)
    NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction, IBindableVector, IBindableVector, Int32, Int32)

    Initializes a new instance of the NotifyCollectionChangedEventArgs class.

    public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IBindableVector newItems, IBindableVector oldItems, Int32 newIndex, Int32 oldIndex)public New(NotifyCollectionChangedAction action, IBindableVector newItems, IBindableVector oldItems, Int32 newIndex, Int32 oldIndex)Public Sub New(action As NotifyCollectionChangedAction, newItems As IBindableVector, oldItems As IBindableVector, newIndex As Int32, oldIndex As Int32)public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IBindableVector newItems, IBindableVector oldItems, Int32 newIndex, Int32 oldIndex)

    Parameters

    Remarks

    When programming with .NET, this class is hidden and developers should use the System.Collections.Specialized.NotifyCollectionChangedEventArgs class.

    Other than action, any of the values for this constructor can potentially be passed as null, depending on the collection change and corresponding Action being reported.

Properties

  • Action
    Action
    Action
    Action

    Gets the description of the action that caused the event.

    public NotifyCollectionChangedAction Action { get; }public NotifyCollectionChangedAction Action { get; }Public ReadOnly Property Action As NotifyCollectionChangedActionpublic NotifyCollectionChangedAction Action { get; }

    Property Value

    Remarks

    When programming with .NET, this class is hidden and developers should use the System.Collections.Specialized.NotifyCollectionChangedEventArgs class.

  • NewItems
    NewItems
    NewItems
    NewItems

    Gets the items affected by an action.

    public IBindableVector NewItems { get; }public IList NewItems { get; }Public ReadOnly Property NewItems As IListpublic IBindableVector NewItems { get; }

    Property Value

    Remarks

    When programming with .NET, this class is hidden and developers should use the System.Collections.Specialized.NotifyCollectionChangedEventArgs class.

  • NewStartingIndex
    NewStartingIndex
    NewStartingIndex
    NewStartingIndex

    Gets the index at which the change occurred.

    public int NewStartingIndex { get; }public int NewStartingIndex { get; }Public ReadOnly Property NewStartingIndex As intpublic int NewStartingIndex { get; }

    Property Value

    • int
      int
      int

      The index at which the change occurred.

    Remarks

    When programming with .NET, this class is hidden and developers should use the System.Collections.Specialized.NotifyCollectionChangedEventArgs class.

    NewStartingIndex will contain the following values, depending on the Action being reported in the event data.

    ActionValue
    AddThe index of the newly added item.
    MoveThe index of the newly added item. Because a Move can logically be considered a virtual Remove followed by a virtual Add, the index reported here might already be adjusted for the virtual Remove.
    Remove-1
    ReplaceThe index of the replaced item.
    Reset-1

    Note that this value is signed. This enables the -1 value cases.

  • OldItems
    OldItems
    OldItems
    OldItems

    Gets the item affected by a Replace or Remove action.

    public IBindableVector OldItems { get; }public IList OldItems { get; }Public ReadOnly Property OldItems As IListpublic IBindableVector OldItems { get; }

    Property Value

    Remarks

    When programming with .NET, this class is hidden and developers should use the System.Collections.Specialized.NotifyCollectionChangedEventArgs class.

  • OldStartingIndex
    OldStartingIndex
    OldStartingIndex
    OldStartingIndex

    Gets the starting index at which a Move, Remove, or Replace action occurred.

    public int OldStartingIndex { get; }public int OldStartingIndex { get; }Public ReadOnly Property OldStartingIndex As intpublic int OldStartingIndex { get; }

    Property Value

    • int
      int
      int

      The zero-based index at which a Move, Remove, or Replace action occurred.

    Remarks

    When programming with .NET, this class is hidden and developers should use the System.Collections.Specialized.NotifyCollectionChangedEventArgs class.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ComposableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Interop.dll