예제 #1
0
 private void Clear()
 {
     if (SelectedItem != null)
     {
         SelectedItem = new PokemonViewModel();
     }
 }
예제 #2
0
 public PokemonsViewModel(IList <Pokemon> PokemonsModel)
 {
     SelectedItem = new PokemonViewModel();
     _pokemons    = new ObservableCollection <PokemonViewModel>();
     foreach (Pokemon a in PokemonsModel)
     {
         _pokemons.Add(new PokemonViewModel(a));
     }
 }
예제 #3
0
 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();
 }