CollectionView.OnCollectionChanged Method

Definition

Raises the CollectionChanged event.

Overloads

OnCollectionChanged(NotifyCollectionChangedEventArgs)

Raises the CollectionChanged event.

C#
protected virtual void OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs args);

Parameters

args
NotifyCollectionChangedEventArgs

The NotifyCollectionChangedEventArgs object to pass to the event handler.

Remarks

Take any sorting, filtering, or grouping criteria into consideration before calling this method to raise the CollectionChanged event.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 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
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

OnCollectionChanged(Object, NotifyCollectionChangedEventArgs)

Raises the CollectionChanged event.

C#
protected void OnCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs args);

Parameters

sender
Object

The sender of the event.

args
NotifyCollectionChangedEventArgs

The NotifyCollectionChangedEventArgs object to pass to the event handler.

Remarks

This method calls ProcessCollectionChanged if it is on the correct UI thread dispatcher and has never been updated from a different thread, or posts the change to the dispatcher to process it on the correct thread.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 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
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9