예제 #1
0
        internal static void ScrollIntoView(NavigationListBox listBox, NodeViewModel node)
        {
            int pos = node.GetPosition();

            if (pos >= listBox.Items.Count)
            {
                Debug.Fail("Internal error");
                throw new InvalidOperationException();
            }

            listBox.ScrollIntoView(listBox.Items[pos]);
        }
예제 #2
0
        internal static void MoveDown(NavigationListBox listBox, NodeViewModel node)
        {
            var nodes = node.ProjectShell.Nodes;

            int pos = node.GetPosition();

            if (pos < nodes.Count - 1)
            {
                var nextNode = nodes[pos + 1];
                ShowNode(listBox, nextNode);
            }
        }
예제 #3
0
        internal static void MoveUp(NavigationListBox listBox, NodeViewModel node)
        {
            var nodes = node.ProjectShell.Nodes;

            int pos = node.GetPosition();

            if (pos > 0)
            {
                var nextNode = nodes[pos - 1];
                ShowNode(listBox, nextNode);
            }
        }
예제 #4
0
 internal static void MoveRight(NavigationListBox listBox, NodeViewModel node)
 {
     if (!node.IsExpanded)
     {
         node.IsExpanded = true;
     }
     else
     {
         if (node.ChildCount > 0)
         {
             var childNode = node.GetChild(0);
             childNode.Show();
         }
     }
 }
예제 #5
0
 internal static void MoveLeft(NavigationListBox listBox, NodeViewModel node)
 {
     if (node.IsExpanded)
     {
         if (node.CanCollapse)
         {
             node.IsExpanded = false;
         }
     }
     else
     {
         var parentNode = node.Parent as NodeViewModel;
         if (parentNode != null)
         {
             ShowNode(listBox, parentNode);
         }
     }
 }
예제 #6
0
 internal static void ShowNode(NavigationListBox listBox, NodeViewModel node)
 {
     ScrollIntoView(listBox, node);
     node.IsSelected = true;
 }