private void HandleRefresh(object sender, ExecutedRoutedEventArgs e) { Cursor saveCursor = Mouse.OverrideCursor; Mouse.OverrideCursor = Cursors.Wait; try { object currentTarget = CurrentSelection != null ? CurrentSelection.Target : null; _visualTreeItems.Clear(); Root = VisualTreeItem.Construct(_root, null); if (currentTarget != null) { VisualTreeItem visualItem = FindItem(currentTarget); if (visualItem != null) { CurrentSelection = visualItem; } } SetFilter(_filter); } finally { Mouse.OverrideCursor = saveCursor; } }
private void Load(object localRoot) { _root = localRoot; _visualTreeItems.Clear(); Root = VisualTreeItem.Construct(localRoot, null); CurrentSelection = _rootVisualTreeItem; SetFilter(_filter); OnPropertyChanged("Root"); }