public CharacterSelectingViewModel(CharacterSelectingModel model) { CharacterSelecting = model; SelectCommand = new Command(SelectCharacter); SearchCharacterCommand = new Command(SearchCharacter); }
private void SelectCharacter() { var sm = new CharacterSelectingModel(); _uiVisualizerService.ShowDialog(new CharacterSelectingViewModel(sm), (sender, e) => { if (!Characters.Any(p => p.Equals(sm.SelectedCharacter, StringComparison.OrdinalIgnoreCase)) && !string.IsNullOrEmpty(sm.SelectedCharacter)) { Characters.Add(sm.SelectedCharacter); SelectedCharacter = sm.SelectedCharacter; } }); }