private async void btnWhen_Click(object sender, RoutedEventArgs e) { OutcomeOverviewViewModel viewModel = (OutcomeOverviewViewModel)((Button)sender).DataContext; OutcomeWhen dialog = new OutcomeWhen(); dialog.Value = viewModel.When; ContentDialogResult result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary && dialog.Value != viewModel.When) { await domainFacade.ChangeOutcomeWhen(viewModel.Key, dialog.Value); viewModel.When = dialog.Value; if (month != null && (dialog.Value.Year != month.Year || dialog.Value.Month != month.Month)) { ViewModel.Items.Remove(viewModel); } if (year != null && (dialog.Value.Year != year.Year)) { ViewModel.Items.Remove(viewModel); } } }
private async void btnWhen_Click(object sender, RoutedEventArgs e) { OutcomeOverviewViewModel viewModel = (OutcomeOverviewViewModel)((Button)sender).DataContext; OutcomeWhen dialog = new OutcomeWhen(); dialog.Value = viewModel.When; ContentDialogResult result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary && dialog.Value != viewModel.When) { await commandDispatcher.HandleAsync(new ChangeOutcomeWhen(viewModel.Key, dialog.Value)); } }