public BookViewModel(int bookId) { bookModel = new BookModel(); isLoading = true; selectChapterCommand = null; selectedChapter = null; selectedChapterContent = null; bookModel.OpenBookAsync(bookId).ContinueWith(epubBook => BookOpened(epubBook), TaskScheduler.FromCurrentSynchronizationContext()); }
private void SelectChapter(ChapterViewModel chapterViewModel) { if (selectedChapter != null) { selectedChapter.IsSelected = false; } selectedChapter = chapterViewModel; selectedChapter.IsTreeItemExpanded = true; selectedChapter.IsSelected = true; SelectedChapterContent = new ChapterContentViewModel(selectedChapter.FilePath, selectedChapter.HtmlContent, images, styleSheets, fonts); }