private void login_button_Click(object sender, RoutedEventArgs e) { if (storeservice.CheckLogin(gebruikersnaam_textbox.Text, wachtwoord_textbox.Password)) { // Create the mainwindow BuyProduct subWindow = new BuyProduct(); // Fix the username textbox subWindow.username_label.Content = gebruikersnaam_textbox.Text.ToString(); // Init the screen subWindow.Init(); // Show the window subWindow.Show(); // Close this this.Close(); } else { // Fout wachtwoord MessageBox.Show("Deze gebruikersnaam wachtwoord combinatie bestaat niet."); } }