public void PurgeMessages() { var question = string.Format("Delete all messages in the queue {0}?", Name); if (MessageBoxResult.Yes == _dialogService.AskQuestion(question, "Delete messages", MessageBoxButton.YesNo)) { _queueService.PurgeMessages(_journalQueue); _eventAggregator.Publish(new RefreshQueuesEvent()); } }
public void HandlePreviewKeyDown(KeyEventArgs args) { if (args.Key == Key.Delete) { if (_dialogService.AskQuestion("Delete selected row(s)?", "Delete", MessageBoxButton.YesNoCancel) != MessageBoxResult.Yes) { args.Handled = true; } } }
void copyOutputCommand_Execute(object parameter) { if (SelectedStream != null && SelectedStream.State != InputStreamState.Stopped) { if (!dialogService.AskQuestion("Copy Output", "Copying text to the clipboard can affect the output text if the current stream is active. Do you want to continue?")) { return; } } Clipboard.SetText(Output); }
private async Task DeleteCustomer(CustomerListItem customerListItem) { var answer = _dialogService.AskQuestion("Delete customer", "Are you sure to delete the customer '" + customerListItem.FullName + "' ?"); if (answer == Answers.Yes) { await Async(() => _customerListService.DeleteCustomer(customerListItem.Id)); Customers.Remove(customerListItem); } }
private async Task SendFeedbackAndRating(int sessionsCountBeforeFeedback, int sessionsCountBeforeRating, int sessionsCount) { try { if (sessionsCount == sessionsCountBeforeRating) { var canRateApp = await _dialogService.AskQuestion("Would you like to rate the app in the Store? It would mean a lot to us!", "Rate us"); if (canRateApp) { await Launcher.LaunchUriAsync( new Uri(string.Format("ms-windows-store:REVIEW?PFN={0}", Windows.ApplicationModel.Package.Current.Id.FamilyName))); } } if (sessionsCount == sessionsCountBeforeFeedback) { var canGiveFeedback = await _dialogService.AskQuestion( "Would you like to give us an email with your opinion about the app? It would mean a lot to us!", "Feedback"); if (canGiveFeedback) { await SendEmail(); } } } catch (Exception exception) { Debug.WriteLine(exception.Message); } }
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state) { if (IsLoggedIn) { var report = await _membersRepository.RefreshClubMembers(); if (report.Successful) { Members = new ObservableCollection <Member>(report.Members); } else { await _dialogService.AskQuestion(report.ErrorMessage); } } _statisticsService.RegisterPage("TimerView"); }