Ejemplo n.º 1
0
        private void HandleRefresh(object sender, ExecutedRoutedEventArgs e)
        {
            var saveCursor = Mouse.OverrideCursor;

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                var currentTarget = CurrentSelection?.Target;

                VisualTreeItems.Clear();

                Root = VisualTreeItem.Construct(_root, null);

                if (currentTarget != null)
                {
                    var visualItem = FindItem(currentTarget);
                    if (visualItem != null)
                    {
                        CurrentSelection = visualItem;
                    }
                }

                SetFilter(_filter);
            }
            finally
            {
                Mouse.OverrideCursor = saveCursor;
            }
        }
Ejemplo n.º 2
0
        private void ProcessFilter()
        {
            if (SnoopModes.MultipleDispatcherMode && !Dispatcher.CheckAccess())
            {
                Action action = ProcessFilter;
                Dispatcher.BeginInvoke(action);
                return;
            }

            VisualTreeItems.Clear();

            // cplotts todo: we've got to come up with a better way to do this.
            if (_filter == "Clear any filter applied to the tree view")
            {
                SetFilter(string.Empty);
            }
            else if (_filter == "Show only visuals with binding errors")
            {
                FilterBindings(_rootVisualTreeItem);
            }
            else if (_filter.Length == 0)
            {
                VisualTreeItems.Add(_rootVisualTreeItem);
            }
            else
            {
                FilterTree(_rootVisualTreeItem, _filter.ToLower());
            }
        }
Ejemplo n.º 3
0
        private void Load(object localRoot)
        {
            _root = localRoot;

            VisualTreeItems.Clear();

            Root             = VisualTreeItem.Construct(localRoot, null);
            CurrentSelection = _rootVisualTreeItem;

            SetFilter(_filter);

            OnPropertyChanged(nameof(Root));
        }
Ejemplo n.º 4
0
 public void ApplyReduceDepthFilter(VisualTreeItem newRoot)
 {
     if (_reducedDepthRoot == newRoot)
     {
         return;
     }
     if (_reducedDepthRoot == null)
     {
         Dispatcher.InvokeAsync(() =>
         {
             VisualTreeItems.Clear();
             VisualTreeItems.Add(_reducedDepthRoot);
             _reducedDepthRoot = null;
         }, DispatcherPriority.Background);
     }
     _reducedDepthRoot = newRoot;
 }