void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.MainLoginWindow = ((WpfApp1.LoginWindow)(target)); return; case 2: this.LoginButton = ((System.Windows.Controls.Button)(target)); return; case 3: this.RegistrationButton = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
private void ButtonSignUp_Click(object sender, RoutedEventArgs e) { if (txtEmail.Text == "" || txtUsername.Text == "") { label1.Content = "Invalid Username and/or Email!"; label1.Visibility = Visibility.Visible; } else if (txtPassword.Password != txtPassword2.Password) { label1.Content = "Passwords don't match!"; label1.Visibility = Visibility.Visible; } else { LoginWindow win = new LoginWindow(); win.Show(); this.Close(); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var kernel = new StandardKernel(new NinjectRegistrations()); IDbRepository crudServ = kernel.Get <IDbRepository>(); Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; AuthInfo authInfo = new AuthInfo(); var loginContext = new LoginWindowViewModel(crudServ, authInfo); var dialog = new LoginWindow(loginContext); var res = dialog.ShowDialog(); if (res == true) { MainWindow window = new MainWindow(new ApplicationViewModel(crudServ, authInfo.User)); window.ShowDialog(); } Current.Shutdown(-1); }
public MainWindow(LoginWindow loginWindow, int Id) { InitializeComponent(); this.loginWindow = loginWindow; this.IdText.Text = Id.ToString(); using (DBEntities context = new DBEntities()) { foreach (Contact c in context.Contacts) { if (c.Id == Id) { listBox.Items.Add(c.FirstName + " " + c.LastName); context.SaveChanges(); } } } }
public CreateAcc(LoginWindow loginWindow) { InitializeComponent(); this.loginWindow = loginWindow; }
/// <summary> /// Ouvre une fenêtre de connection pour l'utilisateur. /// </summary> private void Login_Click(object sender, RoutedEventArgs e) { LoginWindow login = new LoginWindow(); login.ShowDialog(); }