Exemplo n.º 1
0
        private async void Authenticate()
        {
            IsPrimaryButtonEnabled
                      = IsSecondaryButtonEnabled
                      = Account.IsEnabled
                      = Password.IsEnabled
                      = false
                ;

            // Re-focus to disable keyboard
            this.Focus(FocusState.Pointer);

            // Auth async without await
            if (UseSavedPassword)
            {
                LoginInfo Info = await new CredentialVault().Retrieve(Member);
                await Member.Authenticate(Info.Account, Info.Password, true);
            }
            else
            {
                await Member.Authenticate(Account.Text.Trim(), Password.Password, RememberInfo.IsChecked == true);
            }

            if (Member.IsLoggedIn)
            {
                Hide();
            }
            else
            {
                IsPrimaryButtonEnabled
                          = IsSecondaryButtonEnabled
                          = Account.IsEnabled
                          = Password.IsEnabled
                          = true
                    ;
            }
        }