Changing WPF TreeView SelectedItem in SelectedItemChanged event
问题 I currently have a WPF Treeview with a structure of: --> Group 1 (Hierarchical Group) ---> Group 2 (Hierarchical Group) ---> Item 1 ---> Item 2 ---> Item 3 I currently have a SelectedItemChanged event handler hooked up to this treeview like so private void TreeViewControl_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) { if (e.NewValue is Item) { Item item = e.NewValue as Item; if (Item != SelectedItem) { //keep SelectedItem in sync with Treeview.SelectedItem