protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); login = new LoginView(); var loginVM = new LoginViewModel(authoService); login.DataContext = loginVM; login.Show(); }
private void OnLoggedInMessageReceived(string username) { if (username == "un_authorized_user") { login = new LoginView(); var loginVM = new LoginViewModel(authoService); login.DataContext = loginVM; login.Show(); app.Close(); } else { app = new ApplicationView(); var appVM = new ApplicationViewModel(); app.DataContext = appVM; app.Show(); login.Close(); } }
public LoginView() { InitializeComponent(); ViewModel = new LoginViewModel(_authService); this.DataContext = ViewModel; }