Example #1
0
 /// <summary>
 /// Lauches the entry form on startup
 /// </summary>
 /// <param name="e">Arguments of the startup event</param>
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     var currentUser = Authentification.GetCurrentUser();
     if (Authentification.Instance.Authentificated())
     {
         MainViewModel main = new MainViewModel();
         MainView window = new View.MainView {DataContext = main};
         window.Show();
     }
     else
     {
         LoginViewModel authVm = new LoginViewModel();
         LoginView authV = new LoginView();
         authV.Show();
     }
 }
Example #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //if ((txtName.Text != "") & (txtPassword.Text != ""))
            //{
            //    var user = new User();
            //    user.Name = txtName.Text;
            //    user.Password = txtPassword.Text;
            //    if (auth.AuthentificateUser(user))

            //    {
                    MainViewModel main = new MainViewModel();
                    MainView window = new View.MainView { DataContext = main };
                    window.Show();
                    this.Close();
            //    }

            //}
        }