private void addNewPlayerButton_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrWhiteSpace(newPlayerTextBox.Text)) { _gameOptions.AddPlayer(newPlayerTextBox.Text); } newPlayerTextBox.Text = string.Empty; }
private void addNewPlayerButton_Click(object sender, RoutedEventArgs e) { // Check if a non-empty string has been entered in the textbox. If so, add it to the // list of player names. if (!string.IsNullOrWhiteSpace(newPlayerTextBox.Text)) { _gameOptions.AddPlayer(newPlayerTextBox.Text); } newPlayerTextBox.Text = string.Empty; }