Ejemplo n.º 1
0
        InspectViewNode BuildChild(InspectView view, TreeState state)
        {
            var childNode = new InspectViewNode(view, state.AddChild(view));

            Children.Add(childNode);
            childNode.Rebuild(state);
            return(childNode);
        }
Ejemplo n.º 2
0
 public static void Focus(InspectViewNode root, Predicate <InspectViewNode> predicate)
 {
     foreach (var node in root.TraverseTree(i => i.Children.OfType <InspectViewNode>()))
     {
         if (predicate(node))
         {
             node.Focus();
         }
         else
         {
             node.Blur();
         }
     }
 }
Ejemplo n.º 3
0
        static void SelectedViewValueChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs)
        {
            var value = eventArgs.NewValue as InspectView;
            var view  = dependencyObject as VisualRepView;

            if (view.FocusNode?.InspectView == value)
            {
                return;
            }

            if (view.currentViewNode != null)
            {
                InspectViewNode.Focus(view.currentViewNode, node => node?.InspectView == value);
            }
        }