//When The "Edit" Button is clicked private void PokedexManager_ManageDex_Edit_Click(object sender, RoutedEventArgs e) { try { //Edit Pokemon Here! if (((PokedexList_DataBind)PokedexManager_List.SelectedValue).DataType == PokedexList_DataType.Pokemon) { Pokedex.Pokemon.PokemonData Data = (Pokedex.Pokemon.PokemonData)((PokedexList_DataBind)PokedexManager_List.SelectedValue).DataTag; // Gets the Data UI.Pokedex.Pokemon pokemon = new UI.Pokedex.Pokemon(SaveManager.SaveData, Data); // Creates a new window pokemon.ShowDialog(); // Shows the window PokedexManager_ReloadList(); // Updates the list } //Edit Moves Here! else if (((PokedexList_DataBind)PokedexManager_List.SelectedValue).DataType == PokedexList_DataType.Move) { Pokedex.Moves.MoveData Data = (Pokedex.Moves.MoveData)((PokedexList_DataBind)PokedexManager_List.SelectedItem).DataTag; // Gets the Data UI.Pokedex.Moves move = new UI.Pokedex.Moves(SaveManager.SaveData, Data); // Creates a new window move.ShowDialog(); // Shows the window PokedexManager_ReloadList(); // Updates the list } } catch (NullReferenceException) { MessageBox.Show("You cant edit nothing! or can you?"); } }
//When The "Add Move" Button is clicked private void PokedexManager_AddDex_Move_Click(object sender, RoutedEventArgs e) { UI.Pokedex.Moves move = new UI.Pokedex.Moves(SaveManager.SaveData); // Creates Move Editor Page bool? OK = move.ShowDialog(); // Shows the Dialog, waits for return if (OK == true) // When Return { SaveManager.SaveData.PokedexData.Moves.Add(move.MoveData); // Add Move to List PokedexManager_ReloadList(); // Reload Pokedex List } }