private void Login(object state) { string password = (state as PasswordBox).Password; ApplicationVM appvm = App.Current.MainWindow.DataContext as ApplicationVM; ApplicationVM.token = GetToken(password); if (!ApplicationVM.token.IsError) { Error = null; appvm.Login(Username); } else { Error = "Login incorrect."; } }
private void Logout() { ApplicationVM appvm = App.Current.MainWindow.DataContext as ApplicationVM; appvm.Logout(); }