Пример #1
0
 public InstructionViewModel(MainThreadNavigator nav,
                             ICache <SettingsModel> settings,
                             ILogger <InstructionViewModel> logger,
                             bool showDismissButton)
 {
     _nav                = nav;
     _settings           = settings;
     _logger             = logger;
     TitleColHeight      = showDismissButton ? 50 : 0;
     SwitchColHeight     = showDismissButton ? 50 : 0;
     DismissBtnColHeight = showDismissButton ? 50 : 0;
     DismissCommand      = new Command(() =>
     {
         try
         {
             if (NotShowAgain)
             {
                 _settings.Put("", new SettingsModel()
                 {
                     DisplayWelcomeMessage = false
                 });
             }
         }
         catch (Exception ex)
         {
             _logger.LogError($"Failed to update settings cache.", ex);
         }
         _nav.Pop();
     });
 }
        private async Task SubmitFeedback(string feedback)
        {
            if (string.IsNullOrWhiteSpace(feedback))
            {
                return;
            }
            var user = _userCache.GetLoggedInAccount();

            if (user == null)
            {
                var response = await _alertUtility.Display("Not Logged In", "Because you are not logged in, Fair Squares staff will not be able to respond to your feedback. " +
                                                           "Are you sure you want to continue?", "Continue", "Log In");

                if (!response)
                {
                    _nav.Push(_pageFactory.GetPage(PageType.Landing));
                    return;
                }
            }
            try
            {
                _notifier.Notify(new Models.NotificationRequest()
                {
                    From        = "*****@*****.**",
                    To          = "*****@*****.**",
                    Message     = feedback,
                    MessageType = Models.MessageType.Email,
                    Subject     = "Feedback from " + user?.Email
                });
                await _alertUtility.Display("Feedback Submitted", "Thank you for your feedback!", "Ok");
            }
            catch (Exception ex)
            {
                _logger.LogError("Failed to submit feedback.", ex, $"Feedback: {feedback}");
            }
            _nav.Pop();
        }
Пример #3
0
 private void Auth_Completed(object sender, AuthenticatorCompletedEventArgs e)
 {
     _nav.Pop();
 }