static void SelectedItemProperty_Changed(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { TreeViewEx targetObject = dependencyObject as TreeViewEx; if (targetObject != null) { TreeViewItem tvi = targetObject.FindItemNode(targetObject.SelectedItem) as TreeViewItem; if (tvi != null) { tvi.IsSelected = true; } } }