コード例 #1
0
        private async void SignUp_Pressed(object sender, EventArgs e)
        {
            if (await DisplayAlert("Sign up", "Sign up for this event?", "Yes", "No"))
            {
                UserManagerResponseStatus status = await UserManager.Current.MeetingSignup(Meeting);

                if (status == UserManagerResponseStatus.Success)
                {
                    await DisplayAlert("Success!", "You have signed up for this event.", "OK");
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Invoked when social media login button is clicked.
        /// </summary>
        /// <param name="obj">The Object</param>
        private async void SocialLoggedIn(object obj)
        {
            UserManagerResponseStatus status = await UserManager.Current.LoginExternal();

            if (status == UserManagerResponseStatus.Success)
            {
                MessagingCenter.Send <LoginPageViewModel>(this, "LoadApp");
            }
            else if (status == UserManagerResponseStatus.InvalidCredentials)
            {
                ErrorIsVisible = true;
                ErrorMessage   = "Password was incorrect.";
            }
        }
コード例 #3
0
        private async void SignUp_Pressed(object sender, EventArgs e)
        {
            string code = await DisplayPromptAsync("Sign in", "Enter meeting code", initialValue : "");

            UserManagerResponseStatus status = await UserManager.Current.MeetingSignup(Meeting, code);

            if (status == UserManagerResponseStatus.Success)
            {
                await DisplayAlert("Success!", "You have signed in.", "OK");
            }
            else if (status == UserManagerResponseStatus.InvalidCredentials)
            {
                await DisplayAlert("Invalid code", "The meeting code you input was incorrect.", "OK");
            }
        }
コード例 #4
0
        /// <summary>
        /// Invoked when the Send button is clicked.
        /// </summary>
        /// <param name="obj">The Object</param>
        private async void SendClickedAsync(object obj)
        {
            UserManagerResponseStatus status = await UserManager.Current.ForgotPassword(Email);

            switch (status)
            {
            case UserManagerResponseStatus.Success:
                MessagingCenter.Send(this, "ForgotPasswordSuccess");      // display success alert
                break;

            default:
                MessagingCenter.Send(this, "InvalidCredentials");
                break;
            }
        }
コード例 #5
0
        /// <summary>
        /// Invoked when the Log In button is clicked.
        /// </summary>
        /// <param name="obj">The Object</param>
        private async void LoginClicked(object obj)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            var res = App.Current.Resources.MergedDictionaries;

            // TODO: LoginClicked error checks
            if (Password == "" || Email == "")
            {
                ErrorIsVisible = true;
                ErrorMessage   = "Invalid Credentials";
            }

            if (IsInvalidEmail)
            {
                ErrorIsVisible = true;
                ErrorMessage   = "Email is invalid";
            }

            if (!IsInvalidEmail)
            {
                UserManagerResponseStatus status = await UserManager.Current.Login(Email, Password);

                if (status == UserManagerResponseStatus.Success)
                {
                    MessagingCenter.Send <LoginPageViewModel>(this, "LoadApp");
                }
                else if (status == UserManagerResponseStatus.InvalidCredentials)
                {
                    ErrorIsVisible = true;
                    ErrorMessage   = "Password was incorrect.";
                }
            }

            IsBusy = false;
        }