private void addPoke(object sender, RoutedEventArgs e) { Button pokeFace = sender as Button; SaveCharacterData clickedPokemon = (SaveCharacterData)pokeFace.Tag; int keyPair = currentView.Save.SerializeData.characterStorage.characterDataDictionary.Count() + 1; CharacterStorage.ManageData tmpNew = new CharacterStorage.ManageData(); tmpNew.data = clickedPokemon; currentView.Save.SerializeData.characterStorage.characterDataDictionary.Add(keyPair, tmpNew); EditPoke(sender, e); }
private void EditPoke(object sender, RoutedEventArgs e) { Button pokeFace = sender as Button; SaveCharacterData clickedPokemon = (SaveCharacterData)pokeFace.Tag; var poke = currentView.Save.SerializeData.characterStorage.characterDataDictionary.Where(x => x.Value.data == clickedPokemon).FirstOrDefault(); //MessageBox.Show("Clicked on: " + TransformPokeName(poke.Value.data.name)); SaveCharacterData result = null; EditPokemon editing = new EditPokemon(poke.Value.data); editing.ShowDialog(); if (editing.DialogResult.HasValue && editing.DialogResult.Value) { result = editing.GetPokeResult(); currentView.Save.SerializeData.characterStorage.characterDataDictionary.Where(x => x.Value.data == clickedPokemon).FirstOrDefault().Value.data = result; pokeFacesPanel.Children.Clear(); LoadPokemon(); MessageBox.Show("Successfully wrote data to Pokemon"); } }
public EditPokemon(SaveCharacterData pokemon) { InitializeComponent(); pokeResult = pokemon; LoadStuff(); }