/// <summary> /// Collapses the item to hide any child items. /// </summary> public void Collapse() { if (!_expanded) { return; } if (_listView != null) { TreeListViewCancelEventArgs e = new TreeListViewCancelEventArgs(null, this); _listView.OnItemCollapsing(e); if (e.Cancel) { return; } } _expanded = false; if (_items != null && _items.Count > 0) { _listView.RecalculateItemPositions(this); } else { _listView.Invalidate(); } if (_listView != null) { _listView.OnItemCollapsed(new TreeListViewEventArgs(null, this)); } }