private void OnUserAuthenticated(object s, AuthenticateUserCompletedEventArgs e) { if (e.Error != null) { OnError(e.Error, e.Error.Message); } else { LoggedUserContext.LogonPasswordHash( e.Result.Login, e.Result.PasswordHash); } }
private void OkButtonClick(object sender, RoutedEventArgs e) { SetWaitingState(); UserCredentialsViewModel vm = DataContext as UserCredentialsViewModel; // TODO: add some basic validation here if (vm == null) { throw new Exception("Wrong viewmodel type!"); } string login = vm.Model.Username; string password = vm.Model.Password; LoggedUserContext.Logon(login, password); }
private void ButtonLogoutClick(object sender, RoutedEventArgs e) { LoggedUserContext.LogOff(); UpdateUiForLoggedOutUser(); }