private EExpander CreateExpander(CharacterEpisodes ep) { EExpander e = new EExpander(ep); e.OnAddBefore += AddBefore; e.OnRemove += Remove; e.OnAddAfter += OnAddAfter; return(e);; }
private void OnAddAfter(EExpander ex) { CharacterEpisodes nep = new CharacterEpisodes(); nep.Title = "Episode"; int index = Character.Info.IndexOf(ex.Episode); Character.Info.Insert(index + 1, nep); x_episodesHolder.Children.Insert(index + 1, CreateExpander(nep)); }
private void AddBefore(EExpander ee) { CharacterEpisodes nep = new CharacterEpisodes(); nep.Title = "Episode"; int index = Character.Info.IndexOf(ee.Episode); Character.Info.Insert(index, nep); x_episodesHolder.Children.Insert(index, CreateExpander(nep)); }
private void Remove(EExpander ee) { Character.Info.Remove(ee.Episode); x_episodesHolder.Children.Remove(ee); }