private void StartButton_Click(object sender, RoutedEventArgs e) { if (ServerSelect.IsChecked != null && ServerSelect.IsChecked == true) { ServerWindow win = new ServerWindow() { Port = int.Parse(serverPort.Text) }; win.Init(); win.Show(); } else { ClientWindow win = new ClientWindow() { Port = int.Parse(clientPort.Text), Address = clientAddr.Text, ourNickname = clientNick.Text }; win.Init(); win.Show(); } Close(); }