コード例 #1
0
        private async void Button_ClickedAsync(object sender, RoutedEventArgs e)
        {
            var result = await contetDialog.ShowAsync();

            // Delete the file if the user clicked the primary button.
            /// Otherwise, do nothing.
            if (result == ContentDialogResult.Primary)
            {
                string   textTitle      = tbx_title.Text;
                int      signifierCoode = cmb.SelectedIndex;
                DateTime date           = ViewModel.Days.FirstOrDefault().Date;

                var requestMessage  = new AddTaskRequestMessage(textTitle, signifierCoode, date);
                var addTaskUseCase  = new AddTaskInteractor(_bulletRepository);
                var responseMessage = addTaskUseCase.Handle(requestMessage);

                ViewModel.LoadBullets();
                listView.ItemsSource = ViewModel.Days;
            }
            else
            {
                // The user clicked the CLoseButton, pressed ESC, Gamepad B, or the system back button.
                // Do nothing.
            }
        }
コード例 #2
0
        private void AddNewBullet(string textTitle, int signifierCoode, DateTime date)
        {
            var requestMessage  = new AddTaskRequestMessage(textTitle, signifierCoode, date);
            var addTaskUseCase  = new AddTaskInteractor(_bulletRepository);
            var responseMessage = addTaskUseCase.Handle(requestMessage);

            ViewModel.LoadBullets();
            listView.ItemsSource = ViewModel.Days;
        }