Table of Contents

Method ToggleExpandedAndKeepPosAndSelection

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

ToggleExpandedAndKeepPosAndSelection(TreeViewItem?)

Toggles the expanded state of the specified TreeViewItem while preserving the current scroll position and selection.

public virtual void ToggleExpandedAndKeepPosAndSelection(TreeViewItem? item)

Parameters

item TreeViewItem

The TreeViewItem to toggle. If null, no action is performed.

Remarks

This method ensures that the scroll position and selection in the inner ListBox remain unchanged after toggling the expanded state. If the item has the AutoCollapseSiblings property set to true, sibling items will be collapsed.