private void Clear() { if (SelectedItem != null) { SelectedItem = new PokemonViewModel(); } }
public PokemonsViewModel(IList <Pokemon> PokemonsModel) { SelectedItem = new PokemonViewModel(); _pokemons = new ObservableCollection <PokemonViewModel>(); foreach (Pokemon a in PokemonsModel) { _pokemons.Add(new PokemonViewModel(a)); } }
private void Remove() { if (PokemonBusinessLayer.BusinessManager.Instance.DeletePokemon(SelectedItem.poke)) { Pokemons.Remove(SelectedItem); System.Windows.Forms.MessageBox.Show("Supression du pokémon effectuée", "Succeed"); } else { System.Windows.Forms.MessageBox.Show("Error lors de la supression du pokemon", "Failed"); } SelectedItem = new PokemonViewModel(); }