private void addCharacter(object sender, RoutedEventArgs e) { String defaultName = this.getDefaultCharacterName(); CharacterWindow cw = new CharacterWindow(defaultName); cw.ShowDialog(); if (!cw.isValid()) { return; } String name = cw.name; if (this.nameInUse(cw.name)) { name = this.getDefaultCharacterName(); MessageBox.Show("The name '" + cw.name + "' is already in use; name changed to " + name); } this.partyChanged = true; this.partyList.Items.Add(new CharacterRow { present = true, name = name, level = cw.level, totalXp = cw.totalXp, unspentXp = cw.unspentXp }); this.partyList.Items.Refresh(); }