1. SelectedItem是绑定的DataContext 对象
2. Items是绑定对象集合
两层节点的查找方法,可递归扩展多层
// 从第一root节点查找TreeViewItem selectedItem = _TreeView.ItemContainerGenerator.ContainerFromItem(usercombotable.SelectedItem) as TreeViewItem;if (selectedItem != null){return selectedItem;}else{// 遍历root节点foreach (var pItem in usercombotable.Items){// 获取root节点容器TreeViewItemvar rootItem = _TreeView.ItemContainerGenerator.ContainerFromItem(pItem) as TreeViewItem;if (rootItem != null){// 从子节点查找var selectSubItem = rootItem.ItemContainerGenerator.ContainerFromItem(usercombotable.SelectedItem) as TreeViewItem;if (selectSubItem != null){return selectSubItem;}}}}