コード例 #1
0
        private List<ChapterDataModel> LoadChapters()
        {
            using (BookDataContext context = BookDataContext.Connect())
            {
                var chaptersInBook =
                    from chapter in context.Chapters
                    where chapter.BookID == BookId
                    orderby chapter.TokenID
                    select chapter;

                var source = new List<ChapterDataModel>();
                foreach (ChapterModel chapterModel in chaptersInBook)
                {
                    int tokenID = chapterModel.TokenID;
                    var chapter = new ChapterDataModel
                                    {
                                        Depth = chapterModel.Level,
                                        Title = chapterModel.Title.Trim(),
                                        TokenId = tokenID
                                    };

                    source.Add(chapter);
                }

                return source;
            }
        }
コード例 #2
0
 public void GoToChapter(ChapterDataModel chapter)
 {
     _navigationService.UriFor<ReadPageViewModel>()
         .WithParam(vm => vm.BookId, BookId)
         .WithParam(vm => vm.TokenOffset, chapter.TokenId)
         .WithParam(vm => vm.CatalogId, CatalogId)
         .WithParam(vm => vm.CatalogBookItemKey, TransientStorage.Put(CatalogBookItemModel))
         .Navigate();
 }