private void ShowMessage(string text, EventHandler confirmEventHandler) { MessageBoxViewModel = new MessageBoxViewModel(); MessageBoxViewModel.Text = text; MessageBoxViewModel.Confirmed += confirmEventHandler; SetDialog?.Invoke(this, MessageBoxViewModel); }
private void ShowMessage(string text) { MessageBoxViewModel = new MessageBoxViewModel(); MessageBoxViewModel.Text = text; MessageBoxViewModel.Confirmed += delegate { HideDialog?.Invoke(this, null); }; SetDialog?.Invoke(this, MessageBoxViewModel); }
private void InitializeCommands() { _requestUserStoryCreation = new Command( new Action( delegate { StoryDialogViewModel = new StoryDialogViewModel(); StoryDialogViewModel.IsStatusEditable = false; StoryDialogViewModel.Status = _storyStatusesDataModel.GetStatusText(StoryStatus.WaitingForExecutor); StoryDialogViewModel.ConfirmSelected += CreateStoryFromDialog; StoryDialogViewModel.CancelSelected += delegate { HideDialog?.Invoke(this, null); }; SetDialog?.Invoke(this, StoryDialogViewModel); }), null); _finishCommand = new Command( new Action( delegate { ConfirmationDialogViewModel = new ConfirmationDialogViewModel(); ConfirmationDialogViewModel.Text = "Do you really want to finish the sprint now?"; ConfirmationDialogViewModel.ConfirmSelected += FinishCurrentSprint; ConfirmationDialogViewModel.CancelSelected += delegate { HideDialog?.Invoke(this, null); }; SetDialog?.Invoke(this, ConfirmationDialogViewModel); }), null); _requestStoryEditing = new Command( parameterizedAction : delegate(object param) { StoryDialogViewModel = new StoryDialogViewModel(); StoryDialogViewModel.IsStatusEditable = true; StoryDialogViewModel.ConfirmSelected += EditSelectedStory; StoryDialogViewModel.CancelSelected += delegate { HideDialog?.Invoke(this, null); }; FillStoryDialog(param); SetDialog?.Invoke(this, StoryDialogViewModel); }, canExecute: null); _requestStoryRemoving = new Command( parameterizedAction : delegate(object param) { ConfirmationDialogViewModel = new ConfirmationDialogViewModel(); ConfirmationDialogViewModel.Text = "Are you sure you want to delete the user story?"; ConfirmationDialogViewModel.ConfirmSelected += RemoveSelectedStory; ConfirmationDialogViewModel.CancelSelected += delegate { HideDialog?.Invoke(this, null); }; SetDialog?.Invoke(this, ConfirmationDialogViewModel); }, canExecute: null); }
// Use this for initialization void Start() { fingerActionSensitivity = Screen.width * 0.05f; fingerBeginX = 0; fingerBeginY = 0; fingerCurrentX = 0; fingerCurrentY = 0; fingerSegmentX = 0; fingerSegmentY = 0; fingerTouchState = FINGER_STATE_NULL; myPersonButtonListen = FindObjectOfType <PersonButtonListen>(); myPersonalPanel = FindObjectOfType <PersonalPanel>(); mySetDialog = FindObjectOfType <SetDialog>(); buttonAnimation = myPersonButtonListen.GetComponent <Animation>(); setButtonAnimation = mySetDialog.GetComponent <Animation>(); if (myPersonButtonListen) { myPersonButtonListen.gameObject.SetActive(false); } if (myPersonalPanel) { myPersonButtonListen.gameObject.SetActive(false); } if (mySetDialog) { mySetDialog.gameObject.SetActive(false); } }
private void InitializeFields() { Project currentProject = _menuBasedShellViewModel.CurrentProject; if (currentProject == null) { MessageBoxViewModel = new MessageBoxViewModel(); MessageBoxViewModel.Text = "Select project!"; MessageBoxViewModel.Confirmed += delegate { _menuBasedShellViewModel.SetCurrentViewModel(typeof(Projects.ProjectsViewModel)); }; SetDialog?.Invoke(this, MessageBoxViewModel); return; } Data.Entities.Sprint currentSprint = _sprintsDataModel.GetSprintByProjectId(_menuBasedShellViewModel.CurrentProject.Id); if (currentSprint == null) { SprintDialogViewModel = new SprintDialogViewModel(); SprintDialogViewModel.ConfirmSelected += delegate { CreateSprintFromDialog(); // Here sets value of '_currentSprint'. HideDialog?.Invoke(this, null); }; SprintDialogViewModel.CancelSelected += delegate { /*HideDialog?.Invoke(this, null);*/ }; SetDialog?.Invoke(this, SprintDialogViewModel); } else { if (_currentSprint != null) { if (!_currentSprint.Equals(currentSprint)) { _currentSprint = currentSprint; Backlog currentSprintBacklog = ComponentsContainer.Get <IBacklogsDataModel>().GetBacklogById(currentSprint.BacklogId); List <StoryItem> items = ConvertToStoryItems(currentSprintBacklog.Stories); AllUserStories = new ObservableCollection <StoryItem>(items); InitializeSprintDependentFields(); } } else { _currentSprint = currentSprint; Backlog currentSprintBacklog = ComponentsContainer.Get <IBacklogsDataModel>().GetBacklogById(currentSprint.BacklogId); List <StoryItem> items = ConvertToStoryItems(currentSprintBacklog.Stories); AllUserStories = new ObservableCollection <StoryItem>(items); InitializeSprintDependentFields(); } } }
/// <summary> /// 应用程序的设置功能 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MouseLeftButtonDown_Setting(object sender, MouseButtonEventArgs e) { if (setDialog == null) { setDialog = new SetDialog(); } if (setDialog.IsActive) { setDialog.Visibility = Visibility.Visible; } else { setDialog.ShowDialog(); } }
internal LogoutViewModel(MenuBasedShellViewModel menuBasedShellViewModel) { _menuBasedShellViewModel = menuBasedShellViewModel; SetDialog += delegate(object sender, ViewModelBase dialogViewModel) { CurrentDialogViewModel = dialogViewModel; ShowDialog = true; }; HideDialog += delegate { ShowDialog = false; }; ConfirmationDialogViewModel = new ConfirmationDialogViewModel(); ConfirmationDialogViewModel.Text = "Do you really want to log out?"; ConfirmationDialogViewModel.ConfirmSelected += delegate { try { _menuBasedShellViewModel.Logout(); } catch { if (ViewContext != null) { ComponentsContainer.Get <IDialogCoordinator>().ShowMessageAsync( ViewContext, "Log out error", "Please, run applications with administrator rights and try to log out again."); } } }; ConfirmationDialogViewModel.CancelSelected += delegate { _menuBasedShellViewModel.SetCurrentViewModel(typeof(AllUserTasksViewModel)); }; SetDialog?.Invoke(this, ConfirmationDialogViewModel); }