OnSourceCollectionChanged(NotifyCollectionChangedEventArgs) Method

Definition

Assembly TreeDataGrid.Core.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 TreeDataGridCore.Selection.SelectionNodeBase%601.OnItemsAdded(System.Int32%2cSystem.Collections.IList) and TreeDataGridCore.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 TreeDataGridCore.Selection.SelectionNodeBase%601.CollectionChangeState returned by those methods.

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