OnSourceCollectionChanged(NotifyCollectionChangedEventArgs) Method

Definition

Assembly Avalonia.Controls.TreeDataGrid.dll

Called when the Source collection changes.

protected virtual void OnSourceCollectionChanged(NotifyCollectionChangedEventArgs e)

Parameters

e
NotifyCollectionChangedEventArgs

The details of the collection change.

Remarks

The implementation in SelectionNodeBase<T> calls Avalonia.Controls.Selection.SelectionNodeBase%601.OnItemsAdded(System.Int32%2cSystem.Collections.IList) and Avalonia.Controls.Selection.SelectionNodeBase%601.OnItemsRemoved(System.Int32%2cSystem.Collections.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 Avalonia.Controls.Selection.SelectionNodeBase%601.CollectionChangeState returned by those methods.

Override this method and OnSourceCollectionChangeFinished() to provide custom handling of source collection changes.