コード例 #1
0
        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());
            }
        }
コード例 #2
0
 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;
         }
     }
 }
コード例 #3
0
 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);
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
        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");
        }