private void Add_Clicked(object sender, RoutedEventArgs e) { PokeDexEditor editor = new PokeDexEditor(); // Set suggested Pokemon Index to current PokeDex count + 1 editor.TempPokemon.Index = (pokedexLoader.Count() + 1).ToString(); if (editor.ShowDialog() == true) { pokedexLoader.Add(editor.TempPokemon); Update(); } }
private void Edit_Clicked(object sender, RoutedEventArgs e) { if (PokedexListbox.SelectedIndex != -1) { PokeDexEditor editor = new PokeDexEditor(); editor.Setup((Pokemon)PokedexListbox.SelectedItem); if (editor.ShowDialog() == true) { Update(); } } }