Method ToggleExpanded
ToggleExpanded(TreeViewItem?)
Toggles the expanded or collapsed state of the specified tree control item.
public virtual bool ToggleExpanded(TreeViewItem? item)
Parameters
itemTreeViewItemThe TreeViewItem to toggle. If null or not a valid tree item, no action is taken.
Returns
Remarks
If the specified item has child items, this method switches its state between expanded and collapsed. It does not affect the state of child items.