Exemplo n.º 1
0
        async void OnLoginButtonClicked(object sender, EventArgs e)
        {
            var user = new User {
                Email    = emailEntry.Text,
                Password = passwordEntry.Text
            };

            userDB = new UserDatabase();

            if (userDB.AreCredentialsValid(user))
            {
                Navigation.InsertPageBefore(new HomePageCS(), this);
                await Navigation.PopAsync();
            }
            else
            {
                messageLabel.Text  = "Login failed";
                passwordEntry.Text = string.Empty;
            }
        }