Ejemplo n.º 1
0
        public async void Show(Page callingPage)
        {
            RateFeedbackResult result = RateFeedbackResult.None;

            await Task.Delay(1);

            // var rateAnswer = await callingPage.DisplayAlert(RateMessageTitle, RateMessage, RateButtonLabel, RateCancelLabel);

            callingPage.DisplayAlert(RateMessageTitle, RateMessage, RateButtonLabel, RateCancelLabel).ContinueWith(r =>
            {
                if (r.Result)
                {
                    IAppRater rater = DependencyService.Get <IAppRater>();
                    rater.RateApp(this.AppId);
                    result = RateFeedbackResult.Rate;

                    this.RateFeedbackCompleted(callingPage, new RateFeedbackEventArgs(result));
                }
                else
                {
                    //  var feedbackAnswer = await callingPage.DisplayAlert(FeebackMessageTitle, FeebackMessage, FeebackButtonLabel, FeebackCancelLabel);
                    callingPage.DisplayAlert(FeebackMessageTitle, FeebackMessage, FeebackButtonLabel, FeebackCancelLabel).ContinueWith(f =>
                    {
                        if (f.Result)
                        {
                            IEmailComposer emailer = DependencyService.Get <IEmailComposer>();
                            emailer.SendEmail(FeedbackEmail, FeedbackSubject, FeedbackBody);
                            result = RateFeedbackResult.Feedback;

                            this.RateFeedbackCompleted(callingPage, new RateFeedbackEventArgs(result));
                        }
                        else
                        {
                            this.RateFeedbackCompleted(callingPage, new RateFeedbackEventArgs(result));
                        }
                    }, TaskScheduler.FromCurrentSynchronizationContext()
                                                                                                                                       );
                }
            }, TaskScheduler.FromCurrentSynchronizationContext()
                                                                                                                   );
        }
 public RateFeedbackEventArgs(RateFeedbackResult result)
 { this.Result = result; }
Ejemplo n.º 3
0
 public RateFeedbackEventArgs(RateFeedbackResult result)
 {
     this.Result = result;
 }