private void HandleAuthenticationResult(AuthenticationResultPackage package) { InvokeGui(() => { StackPanelButtons.Visibility = Visibility.Visible; StackPanelLoggingIn.Visibility = Visibility.Collapsed; }); switch (package.Result) { case AuthenticationResult.Ok: LoggedIn = true; InvokeGui(async() => { StatusSnackbar.MessageQueue.Enqueue("Login was successfull."); ButtonLogin.IsEnabled = false; ButtonRegister.IsEnabled = false; await TaskDelay(1500); Close(); }); break; case AuthenticationResult.Failed: InvokeGui(() => { StatusSnackbar.MessageQueue.Enqueue("Login failed. Check username and/or password and try it again."); }); break; } }
private void HandleAuthenticationPackage(AuthenticationResultPackage package) { if (package.Result == AuthenticationResult.Ok) { InvokeGui(() => { _viewModel.MyUsername = App.Username; }); } }