private async Task ExecuteLoginCommand()
        {
            if (IsBusy)
            {
                return;
            }

            if (!CrossConnectivity.Current.IsConnected)
            {
                EventAggregator.GetEvent <OfflineEvent>().Publish();
                return;
            }


            if (Settings.IsLoggedIn)
            {
                var response = await PageDialogService.DisplayAlertAsync("Logout?",
                                                                         "Are you sure you want to logout? You can only save favorites and leave feedback when logged in.",
                                                                         "Yes, Logout", "Cancel");

                if (response)
                {
                    await Logout();
                }

                return;
            }

            Logger.Log($"{AppPage.Login.ToString()}, Settings", Category.Info, Priority.None);
            GoToModalCommand.Execute(new List <string> {
                nameof(LoginPage)
            });
        }
示例#2
0
 public void OnNavigatedTo(NavigationParameters parameters)
 {
     if (!parameters.ContainsKey("ComingBack") && !parameters.ContainsKey("Tab") && Settings.FirstRun && !Settings.IsLoggedIn)
     {
         GoToModalCommand.Execute(new List <string> {
             nameof(LoginPage)
         });
         return;
     }
     UpdatePage();
 }