Skip to main content

TreeSelectionModelSourceResetEventArgs Class

Definition

Assembly:Avalonia.Controls.TreeDataGrid
Package:Avalonia.Controls.TreeDataGrid
public class TreeSelectionModelSourceResetEventArgs

Inheritance: EventArgs -> TreeSelectionModelSourceResetEventArgs

Remarks

This event is raised when a collection in the hierarchical data structure is reset, such as when the collection is cleared or replaced with a new collection.

The event provides information about which part of the hierarchical structure was reset through the Avalonia.Controls.Selection.TreeSelectionModelSourceResetEventArgs.ParentIndex property, allowing handlers to determine whether the entire source was reset or just a subtree within the hierarchy.

Constructors

TreeSelectionModelSourceResetEventArgs Constructor

Initializes a new instance of the Avalonia.Controls.Selection.TreeSelectionModelSourceResetEventArgs class.

public TreeSelectionModelSourceResetEventArgs(Avalonia.Controls.IndexPath parentIndex)

Parameters

parentIndex Avalonia.Controls.IndexPath

The index path to the parent item whose children collection was reset.

Remarks

When the root collection is reset, parentIndex will be empty.

When a child collection is reset, parentIndex will contain the path to the parent item containing that child collection.

Properties

NameDescription
ParentIndexGets the index path to the parent item whose children collection was reset.

ParentIndex Property

Gets the index path to the parent item whose children collection was reset.

public Avalonia.Controls.IndexPath ParentIndex { get; set; }

Value

An Avalonia.Controls.IndexPath identifying the parent item in the hierarchy.

Remarks

When the root collection is reset, this property will be an empty path.

When a child collection is reset, this property will contain the path to the parent item containing that child collection.

This information is useful for determining which part of the selection may have been affected by the reset and may need to be updated or restored.