public void Expand()
        {
            TreeNode treeNode = tree.Node("Root");

            treeNode.Expand();
            Assert.AreEqual(true, treeNode.IsExpanded());
        }
        public void Collapse()
        {
            TreeNode treeNode = tree.Node("Root");

            treeNode.Expand();
            treeNode.Collapse();
            Assert.AreEqual(false, treeNode.IsExpanded());
        }
Exemple #3
0
        public override void HookEvents(UIItemEventListener eventListener)
        {
            clickedTreeNodeHandler = delegate
            {
                TreeNode node = ClickedNode;
                eventListener.EventOccured((new TreeNodeClickedEvent(this, node, node.IsExpanded())));
            };

            selectedTreeNodeHandler = delegate
            {
                TreeNode node = SelectedNode;
                eventListener.EventOccured((new TreeNodeSelectEvent(this, node)));
            };

            Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Subtree, clickedTreeNodeHandler,
                                                                ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty);
            Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Subtree, selectedTreeNodeHandler,
                                                                SelectionItemPatternIdentifiers.IsSelectedProperty);
        }
        public void NodeIsExpanded()
        {
            TreeNode treeNode = tree.Node("Root");

            Assert.AreEqual(false, treeNode.IsExpanded());
        }