Esempio n. 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]);
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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();
         }
     }
 }
Esempio n. 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);
         }
     }
 }
Esempio n. 6
0
 internal static void ShowNode(NavigationListBox listBox, NodeViewModel node)
 {
     ScrollIntoView(listBox, node);
     node.IsSelected = true;
 }