public CharacterSelectionDialog_ViewModel() { var clist = CharacterList.Instance; foreach (Character c in clist.GetCharacterList()) { AllCharactersList.Add(c); } }
private void RemoveCharacterFromCombatants() { var this_model = (CharacterSelectionDialog_ViewModel)DataContext; var combatant = (Character)SelectedCombatantsList.SelectedItem; if (combatant != null) { this_model.RemoveCharacterFromCombatantsList(combatant); } AllCharactersList.Focus(); if (AllCharactersList.Items.Count > 0) { AllCharactersList.SelectedIndex = 0; } }