public void DeleteEvolution() { try { if (SelectedEvolution < 0 || SelectedEvolution > PokemonEvolutionList.Count - 1) { throw new Exception("Index wybranej ewolucji jest poza zakresem."); } else { PokemonEvolutionList.RemoveAt(SelectedEvolution); OnPropertyChanged("PokemonEvolutionList"); } } catch (Exception e) { MessageBox.Show(e.ToString()); } }
public void AddEvolution() { try { if (SelectedPokemon < 0 || SelectedPokemon > PokemonList.Count - 1) { throw new Exception("Nie wybrano żadnej ewolucji."); } else { PokemonEvolutionList.Add(PokemonList[SelectedPokemon]); OnPropertyChanged("PokemonEvolutionList"); } } catch (Exception e) { MessageBox.Show(e.ToString()); } }