public void UnselectAllExceptOf(ExtendedTreeViewItem treeViewItem) { var containers = this.GetItemContainers(); containers.Remove(treeViewItem); containers.ForEach(p => p.IsSelected = false); // Notwendig für Drag and Drop, da Element nicht existiert, während es wechselt this.SelectedItems = new ExtendedObservableCollection <object>(); var containersToUpdate2 = (from p in this.GetItemContainers() where p == treeViewItem select p).ToList(); containersToUpdate2.ForEach(p => p.Focus()); }
public static object GetItemFromContainer(this ExtendedTreeView treeView, ExtendedTreeViewItem item) { return(item.DataContext); }