Exemple #1
0
        //用户双击选中进入查看某个查找结果
        private void NodeList_DbClick(object sender, MouseButtonEventArgs e)
        {
            ListView   currentList  = (sender as SearchResult).NodeListView;
            MyTreeNode selectedNode = currentList.SelectedItem as MyTreeNode;

            if (selectedNode != null)
            {
                if (MyTrees.GetLeafAloneNodeIds().Contains(selectedNode.SysId))
                {
                    listNodes.Visibility           = Visibility.Visible;
                    myTreeView.Visibility          = Visibility.Collapsed;
                    listNodes.grpHeader.Text       = "孤立的叶子节点";
                    listNodes.nodeList.ItemsSource = new List <MyTreeNode> {
                        selectedNode
                    };
                    datasetInfoView.SelectTab("leaf");
                }
                else if (MyTrees.GetRingNodeIds().Contains(selectedNode.SysId))
                {
                    listNodes.Visibility           = Visibility.Visible;
                    myTreeView.Visibility          = Visibility.Collapsed;
                    listNodes.grpHeader.Text       = "构成闭环的节点";
                    listNodes.nodeList.ItemsSource = new List <MyTreeNode> {
                        selectedNode
                    };
                    datasetInfoView.SelectTab("ring");
                }
                else
                {
                    myTreeView.SetRootNode(selectedNode);
                    SwitchTabView("tree");
                    datasetInfoView.SelectTab("tree");
                    myTreeView.ExpandRootNode(1);    //打开一级子节点
                }
            }
            Refresh_Online_time();
        }