예제 #1
0
        public async void DeleteTaskAsync(object taskObject)
        {
            TaskViewModel taskViewModel = taskObject as TaskViewModel;

            if (await MessageService.ShowDialog("Are you sure?"))
            {
                await ListViewModel.projectManager.DeleteTaskFromCurrentProject(taskViewModel.Task, Project);

                Tasks.Remove(taskViewModel);
                OnPropertyChanged("TaskList");
            }
        }
        private async void DeleteProject(object projectObject)
        {
            Services.IMessageService MessageService = DependencyService.Get <Services.IMessageService>();
            if (await MessageService.ShowDialog("Are you sure?"))
            {
                await Navigation.PopAsync();

                ProjectViewModel project = projectObject as ProjectViewModel;
                await projectManager.DeleteProjectAsync(project.Project);

                Projects.Remove(project);
            }
        }
예제 #3
0
        private void ExecuteReturnBtnCmd()
        {
            if (_messageService.Question("値を戻しますか?") == System.Windows.MessageBoxResult.OK)
            {
                _messageService.ShowDialog("OK");

                var dp = new DialogParameters();
                dp.Add(nameof(Text), Text);

                // DialogResult の第1引数は、呼び出し元の画面に「何のボタンが押されたか?」を教えるためのもの
                RequestClose?.Invoke(new DialogResult(ButtonResult.OK, dp));
            }
        }