I have a scenario where if a root level node contains 1 child, I need that child to be selected, but I don't see any type of "childNode" collection. I apparently can only set a XamTreeitem to "IsSelected" ==true
but I don't see how to get to it?
Never mind I figured it out (for anyone that's interested) the types and Categories are what's loaded into the tree.
private void treeCatType_ItemExpansionChanged(object sender, ExpansionChangedEventArgs e) { if (e.IsExpanded) { XamTreeItem itm = (XamTreeItem)e.SourceItem; CriteriaSearchCategory cat = (CriteriaSearchCategory)itm.Data; if (cat.SearchTypes.Count==1) { if (itm.HasChildren == true) { CriteriaSearchType type = (CriteriaSearchType)itm.Items[0]; ViewModel.SelectedSearchType = type; XamTreeItem curItem = itm.XamTreeItems.First(x => x.Data == type); if (curItem!=null) { curItem.IsSelected = true; curItem.ScrollItemIntoView(); } } } } }