ListChangedEventArgs Constructors

Definition

Initializes a new instance of the ListChangedEventArgs class.

Overloads

ListChangedEventArgs(ListChangedType, PropertyDescriptor)

Initializes a new instance of the ListChangedEventArgs class given the type of change and the PropertyDescriptor affected.

ListChangedEventArgs(ListChangedType, Int32)

Initializes a new instance of the ListChangedEventArgs class given the type of change and the index of the affected item.

ListChangedEventArgs(ListChangedType, Int32, PropertyDescriptor)

Initializes a new instance of the ListChangedEventArgs class given the type of change, the index of the affected item, and a PropertyDescriptor describing the affected item.

ListChangedEventArgs(ListChangedType, Int32, Int32)

Initializes a new instance of the ListChangedEventArgs class given the type of change and the old and new index of the item that was moved.

ListChangedEventArgs(ListChangedType, PropertyDescriptor)

Source:
ListChangedEventArgs.cs
Source:
ListChangedEventArgs.cs
Source:
ListChangedEventArgs.cs

Initializes a new instance of the ListChangedEventArgs class given the type of change and the PropertyDescriptor affected.

C#
public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, System.ComponentModel.PropertyDescriptor propDesc);
C#
public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, System.ComponentModel.PropertyDescriptor? propDesc);

Parameters

listChangedType
ListChangedType

A ListChangedType value indicating the type of change.

propDesc
PropertyDescriptor

The PropertyDescriptor that was added, removed, or changed.

Remarks

This constructor can be used only if the schema of the object has changed.

The listChangedType parameter should be PropertyDescriptorAdded, PropertyDescriptorChanged, or PropertyDescriptorDeleted.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

ListChangedEventArgs(ListChangedType, Int32)

Source:
ListChangedEventArgs.cs
Source:
ListChangedEventArgs.cs
Source:
ListChangedEventArgs.cs

Initializes a new instance of the ListChangedEventArgs class given the type of change and the index of the affected item.

C#
public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, int newIndex);

Parameters

listChangedType
ListChangedType

A ListChangedType value indicating the type of change.

newIndex
Int32

The index of the item that was added, changed, or removed.

Remarks

Use this constructor if only one item is affected by a change. In this case, the OldIndex property is set to -1.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

ListChangedEventArgs(ListChangedType, Int32, PropertyDescriptor)

Source:
ListChangedEventArgs.cs
Source:
ListChangedEventArgs.cs
Source:
ListChangedEventArgs.cs

Initializes a new instance of the ListChangedEventArgs class given the type of change, the index of the affected item, and a PropertyDescriptor describing the affected item.

C#
public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, int newIndex, System.ComponentModel.PropertyDescriptor propDesc);
C#
public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, int newIndex, System.ComponentModel.PropertyDescriptor? propDesc);

Parameters

listChangedType
ListChangedType

A ListChangedType value indicating the type of change.

newIndex
Int32

The index of the item that was added or changed.

propDesc
PropertyDescriptor

The PropertyDescriptor describing the item.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

ListChangedEventArgs(ListChangedType, Int32, Int32)

Source:
ListChangedEventArgs.cs
Source:
ListChangedEventArgs.cs
Source:
ListChangedEventArgs.cs

Initializes a new instance of the ListChangedEventArgs class given the type of change and the old and new index of the item that was moved.

C#
public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, int newIndex, int oldIndex);

Parameters

listChangedType
ListChangedType

A ListChangedType value indicating the type of change.

newIndex
Int32

The new index of the item that was moved.

oldIndex
Int32

The old index of the item that was moved.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1