public LoginPage() { InitializeComponent(); auth = DependencyService.Get <IFirebaseAuthentication>(); BindingContext = new User(); userRepository = new UserRepository(); }
public ProfileTabPage() { InitializeComponent(); userRepository = new UserRepository(); firebaseStorageService = new FirebaseStorageService(); auth = DependencyService.Get <IFirebaseAuthentication>(); Appearing += OnAppearing; }
public App() { InitializeComponent(); userRepository = new UserRepository(); auth = DependencyService.Get <IFirebaseAuthentication>(); MainPage = new LoadingPage(); }
public LogInPage() { InitializeComponent(); BindingContext = viewModel = new LoginViewModel(); auth = DependencyService.Get <IFirebaseAuthentication>(); this.BackgroundImage = "background.png"; loginStack.BackgroundColor = System.Drawing.Color.FromArgb(140, 0, 0, 0); showPass.Toggled += (sender, e) => { _ = e.Value ? PassEntry.IsPassword = false : PassEntry.IsPassword = true; }; }
public LoginPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService) { _navigationService = navigationService; _pageDialogService = pageDialogService; _firebaseAuth = DependencyService.Get<IFirebaseAuthentication>(); if (!string.IsNullOrEmpty(Settings.UserEmail)) { Email = Settings.UserEmail; } }
public App() { InitializeComponent(); auth = DependencyService.Get <IFirebaseAuthentication>(); if (auth.IsSignIn()) { MainPage = new MainPage(); } else { MainPage = new LoginPage(); } }
private async void OnLoginButtonClicked(object sender, EventArgs e) { IsBusy = true; _email = this.FindByName <Entry>("email").Text; _password = this.FindByName <Entry>("password").Text; if (String.IsNullOrWhiteSpace(_email)) { await Application.Current.MainPage.DisplayAlert("Błąd walidacji", "Pole z adresem email nie może być puste", "OK"); return; } if (String.IsNullOrWhiteSpace(_password)) { await Application.Current.MainPage.DisplayAlert("Błąd walidacji", "Pole z hasłem nie może być puste", "OK"); return; } try { IFirebaseAuthentication auth = DependencyService.Get <IFirebaseAuthentication>(); string token = await auth.Login(_email, _password); await Application.Current.MainPage.DisplayAlert("Sukces logowania", $"Adres email: {_email}\nHasło: {_password}", "Noice"); _isLoggedIn = auth.IsUserLoggedIn(); if (_isLoggedIn) { this.FindByName <Button>("logoutButton").IsVisible = true; } } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("Błąd logowania", $"Wystąpił problem podczas logowania: {ex.Message}", "OK"); } ChangeButtonVisibility(); IsBusy = false; }
private void OnLogoutButtonClicked(object sender, EventArgs e) { IsBusy = true; try { IFirebaseAuthentication auth = DependencyService.Get <IFirebaseAuthentication>(); auth.Logout(); _isLoggedIn = false; this.FindByName <Entry>("email").Text = ""; this.FindByName <Entry>("password").Text = ""; _email = _password = ""; } catch (Exception ex) { Application.Current.MainPage.DisplayAlert("Błąd wylogowania", $"Wystąpił problem podczas wylogowania: {ex.Message}", "OK"); } ChangeButtonVisibility(); IsBusy = false; }
public LoginPage() { InitializeComponent(); auth = DependencyService.Get <IFirebaseAuthentication>(); BindingContext = viewModel = new LoginViewModel(); }
public MainPage() { InitializeComponent(); auth = DependencyService.Get <IFirebaseAuthentication>(); }
public Register() { InitializeComponent(); auth = DependencyService.Get <IFirebaseAuthentication>(); }
public LoginViewModel() { authentication = DependencyService.Get <IFirebaseAuthentication>(); SubmitCommand = new Command(OnSubmit); }