public AuthViewModel(IAuthLogic authLogic) { this.authLogic = authLogic; this.Login = new RelayCommand <PasswordBox>(x => { User u = new User { ValidationName = userName, Password = x }; SimpUser s = authLogic.Auth(u); if (s.Token != null) { MainWindow win = new MainWindow(s.Token, s); win.Show(); Application.Current.MainWindow.Close(); } }, true); }