private void EventSetter_OnHandler(object sender, MouseEventArgs e)
        {
            var xdt = sender as CellValuePresenter;
            var cpr = xdt.TryFindParent <DataRecordPresenter>();
            var ep  = cpr.DataRecord.DataItem as NeighborhoodWatch;

            if (ep != null && ep.DetectedById > 0)
            {
                var leftModel = PageNavigatorHelper.GetLeftElementViewModel();
                var rightEle  = PageNavigatorHelper._MainWindow.RightTreeElement;

                if (leftModel != null)
                {
                    if (!rightEle.Model.DirectoryPushed)
                    {
                        rightEle.OnDirectoryClick();
                    }
                    leftModel.ChangeEndpointNavigationState();
                    var enp       = ApplicationContext.EndPointListAll.Find(r => r.EndpointId == ep.DetectedById);
                    var dir       = ApplicationContext.FolderListAll.Find(r => r.FolderId == enp.FolderId);
                    var listNodes = new List <int>();
                    GetParentListId(listNodes, dir);
                    PageNavigatorHelper.GetRightElementViewModel().SelectTreeNode(ep.DetectedById, listNodes, TreeViewSelectMode.Endpoint);
                }
            }
        }
Exemple #2
0
        private void OnFromLDAPCommand(object arg)
        {
            _view.BdAddButton.Visibility = Visibility.Collapsed;
            _view.menugrid.Visibility    = Visibility.Hidden;

            var leftViewModel = PageNavigatorHelper.GetLeftElementViewModel();

            if (leftViewModel != null)
            {
                leftViewModel.SelectedLDAPNavigation();
                PageNavigatorHelper.Switch(new LDAPPage());
            }
        }
Exemple #3
0
        private void OnImportFromFileExecute(object pars)
        {
            _view.menugrid.Visibility    = Visibility.Hidden;
            _view.BdAddButton.Visibility = Visibility.Collapsed;
            //Show Import From File dialog
            //_view.ShowImportFileDialog(ApplicationContext.NodeId);

            //Navigation to Import Page
            var importFilePage = new ImportFilePage(ApplicationContext.NodesSelected.Count > 0 ? ApplicationContext.NodesSelected[0].NodeId : 1);
            var leftModel      = PageNavigatorHelper.GetLeftElementViewModel();

            if (leftModel != null)
            {
                if (NavigationIndex != (int)NavigationIndexes.Endpoint && NavigationIndex != (int)NavigationIndexes.Label)
                {
                    leftModel.ChangeEndpointNavigationState();
                }
            }
            PageNavigatorHelper.Switch(importFilePage);
        }