/// <summary> /// Recursively select all children. /// </summary> public void SelectAllExpandedChildren() { if (Items != null && Items.Count > 0) { if (this.IsExpanded) { foreach (var item in Items) { if (item is MSTreeViewItem) { ((MSTreeViewItem)item).SelectAllExpandedChildren(); } else { MSTreeViewItem tvItem = this.ItemContainerGenerator.ContainerFromItem(item) as MSTreeViewItem; if (tvItem != null) { tvItem.SelectAllExpandedChildren(); } } } } } if (!this.IsSelected) { this.IsSelected = true; ParentMultipleSelectionTreeView.OnSelectionChanges(this); } }
public void SelectAllExpandedItems() { if (Items != null && Items.Count > 0) { foreach (var item in Items) { if (item is MSTreeViewItem) { ((MSTreeViewItem)item).SelectAllExpandedChildren(); } else { MSTreeViewItem tvItem = this.ItemContainerGenerator.ContainerFromItem(item) as MSTreeViewItem; if (tvItem != null) { tvItem.SelectAllExpandedChildren(); } } } } }