private void UpdateLabel(string name) { if (name.Length > 200) { var messageDialog = PageNavigatorHelper._MainWindow.MessageDialogContentControl.Content as MessageDialog; messageDialog.ShowMessageDialog("Label name cannot more than 200 letters", "Message"); return; } var viewModel = DataContext as LabelCriteriaViewModel; var label = new POC.Common.Model.Endpoint.Label { LabelId = viewModel.LabelId, LabelName = name }; var labelsPage = PageNavigatorHelper.GetMainContent <LabelsPage>(); if (labelsPage != null) { var labelViewModel = labelsPage.DataContext as LabelViewModel; if (labelViewModel != null) { labelViewModel.EditLabel(label); } _headerExpanderOrg = name; var rightViewModel = PageNavigatorHelper.GetRightElementViewModel(); ApplicationContext.IsRebuildTree = true; rightViewModel.LoadLabelView(); } }
private void MoveBackground_DoWork(object sender, DoWorkEventArgs e) { _view.Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() => { var dnlist = e.Argument as List <DirectoryNode>; var ldapView = PageNavigatorHelper.GetMainContent <LDAPPage>(); if (ldapView != null) { var listMove = new ObservableCollection <DirectoryNode>(); foreach (var dn in dnlist) { listMove.Add(dn); } ldapView.MoveNotes(listMove, new Guid().ToString(), ApplicationContext.NodeTargetId, true); } })); }
private void OnChangeUpdateSourceSchedulingCommand(object arg) { var changeUpdSourceBg = new BackgroundWorker(); changeUpdSourceBg.DoWork += ChangeUpdSourceBg_DoWork; changeUpdSourceBg.RunWorkerAsync(); var transferPage = PageNavigatorHelper.GetMainContent <TransferPage>(); var mainScheduling = transferPage.MainSchedulingElement; var isNotSelectedUpdateSource = true; foreach (var updschedule in mainScheduling.PnlLeftUpdateSource.Children) { if (updschedule.GetType() == typeof(UpdateSourceSchedulingElement)) { var usse = updschedule as UpdateSourceSchedulingElement; if (usse.Model.IsSelected) { isNotSelectedUpdateSource = false; break; } } } if (isNotSelectedUpdateSource) { foreach (var updschedule in mainScheduling.PnlRightUpdateSource.Children) { if (updschedule.GetType() == typeof(UpdateSourceSchedulingElement)) { var usse = updschedule as UpdateSourceSchedulingElement; if (usse.Model.IsSelected) { isNotSelectedUpdateSource = false; break; } } } } mainScheduling.Model.IsUpdateSourceNotChecked = isNotSelectedUpdateSource; }