internal void SelectItem(object target) { ElementTreeItem node = _root.FindNode(target); Visual rootVisual = _root.MainVisual; if (node == null) { Visual visual = target as Visual; if (visual != null && rootVisual != null) { // ensure that the visual is contained within the subtree of the _root element if (!visual.IsDescendantOf(rootVisual)) { _root = new VisualItem(PresentationSource.FromVisual(visual).RootVisual, null); } } _root.Reload(); _root.UpdateVisualChildrenCount(); node = _root.FindNode(target); Filter = _filter; } if (node != null) { SelectedItem = node; } }
private void Load(object rootTarget) { _filtered.Clear(); _root = ElementTreeItem.Construct(rootTarget, null); _root.Reload(); _root.UpdateVisualChildrenCount(); Filter = _filter; }
private void Refresh() { object currentTarget = (SelectedItem != null) ? SelectedItem.Target : null; _filtered.Clear(); _root = ElementTreeItem.Construct(_rootObject, null); _root.Reload(); _root.UpdateVisualChildrenCount(); if (currentTarget != null) { SelectItem(currentTarget); } Filter = _filter; }