Пример #1
0
        private async void Button_LoginAAD(object sender, RoutedEventArgs e)
        {
            ((Button)sender).IsEnabled = false;

            bool success = await connectedDevicesManager.SignInAadAsync();

            if (!success)
            {
                rootPage.NotifyUser("AAD login failed!", NotifyType.ErrorMessage);
            }
            else
            {
                rootPage.NotifyUser("AAD login successful", NotifyType.StatusMessage);
            }
        }
        private async void Button_LoginAAD(object sender, RoutedEventArgs e)
        {
            if (m_state == LoginState.LOGGED_OUT)
            {
                UpdateView(LoginState.LOGIN_PROGRESS);
                bool success = await m_connectedDevicesManager.SignInAadAsync();

                if (!success)
                {
                    m_rootPage.NotifyUser("AAD login failed!", NotifyType.ErrorMessage);
                    UpdateView(LoginState.LOGGED_OUT);
                }
                else
                {
                    m_rootPage.NotifyUser("AAD login successful", NotifyType.StatusMessage);
                    UpdateView(LoginState.LOGGED_IN_AAD);
                }
            }
            else
            {
                LogoutCurrentAccount();
            }
        }