private void Button_Click(object sender, RoutedEventArgs e) { String username = textbox1.Text.ToString(); String password = textbox2.Text.ToString(); if (ClientService.login(username, password) == false) { MessageBox.Show("Nume sau parola gresita"); } else { //Chat win2 = new Chat(ClientService.getClient()); Chat win2 = new Chat(communication, username); win2.Show(); this.Close(); } }