private void LoginPage_Loaded(object sender, RoutedEventArgs e)
 {
     if (AzureCustomUserHelper.CheckLoggedIn())
     {
         Debug.WriteLine("User is logged in");
         NavigateHome();
     }
 }
 private async void LoginButton_Click(object sender, RoutedEventArgs e)
 {
     ToggleProgressRing();
     if (UsernameText.Text.Equals("") || PasswordText.Password.Equals(""))
     {
         await new Windows.UI.Popups.MessageDialog("Please ensure Username and Password are entered").ShowAsync();
     }
     else
     {
         string response = "";
         if (isLoggingin)
         {
             response = await AzureCustomUserHelper.LoginAsync(UsernameText.Text, PasswordText.Password);
         }
         else
         {
             if (!PasswordText.Password.Equals(RePasswordText.Password))
             {
                 response = "Ensure that your passwords match";
             }
             else if (EmailText.Text.Equals(""))
             {
                 response = "Please enter your email address";
             }
             else
             {
                 response = await AzureCustomUserHelper.SignUpAsync(UsernameText.Text, PasswordText.Password, EmailText.Text);
             }
         }
         if (response.Equals("Success"))
         {
             NavigateHome();
         }
         else
         {
             await new Windows.UI.Popups.MessageDialog(response).ShowAsync();
         }
     }
     ToggleProgressRing();
 }