/// <summary> /// Creates a new MainViewModel /// </summary> public MainViewModel(IChapterViewModelFactory chapter_factory, DialogManager dialog, MangasTask task, IMangaViewModelFactory manga_factory) { DisplayName = "MeliMelo - Mangas"; chapter_factory_ = chapter_factory; dialog_ = dialog; manga_factory_ = manga_factory; mangas_ = new BindableCollection<MangaViewModel>(); selected_manga_ = null; task_ = task; }
/// <summary> /// Creates a new MangaViewModel /// </summary> /// <param name="factory">Chapter factory</param> /// <param name="manga">Manga to wrap</param> /// <param name="task">Mangas task</param> public MangaViewModel(IChapterViewModelFactory factory, Manga manga, MangasTask task) { DisplayName = manga.Name; chapters_ = new List<ChapterViewModel>(); factory_ = factory; manga_ = manga; manga_.NewChapter += OnMangaNewChapter; task_ = task; foreach (var chapter in manga_.Chapters) chapters_.Add(factory_.Create(manga_, chapter, task_)); }