Skip to main content

OnSourceCollectionChanged Method

Called when the Source collection changes.

Definition

Namespace: Avalonia.Controls.Selection
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)

protected virtual void OnSourceCollectionChanged(
NotifyCollectionChangedEventArgs e
)

Parameters

  NotifyCollectionChangedEventArgs
The details of the collection change.

Remarks

The implementation in SelectionNodeBase(T) calls OnItemsAdded(Int32, IList) and OnItemsRemoved(Int32, IList) in order to calculate how the collection change affects the currently selected items. It then calls OnIndexesChanged(Int32, Int32) and OnSelectionRemoved(Int32, Int32, IReadOnlyList(T)) if necessary, according to the SelectionNodeBase(T).CollectionChangeState returned by those methods. Override this method and OnSourceCollectionChangeFinished() to provide custom handling of source collection changes.

See Also

Reference

SelectionNodeBase(T) Class
Avalonia.Controls.Selection Namespace