protected override void OnInitialize() { base.OnInitialize(); if (TransientStorage.Contains(CatalogBookItemKey)) { CatalogBookItemModel = TransientStorage.Get <CatalogBookItemModel>(CatalogBookItemKey); } }
protected override void OnInitialize() { base.OnInitialize(); if (TransientStorage.Contains(CatalogBookItemKey)) { CatalogBookItemModel = TransientStorage.Get <CatalogBookItemModel>(CatalogBookItemKey); } _book = _bookRepository.Get(BookId, false); DisplayName = string.Format(UIStrings.SearchInBookPage_Title, _book.Title).ToUpper(); }
protected override void OnInitialize() { base.OnInitialize(); if (TransientStorage.Contains(CatalogBookItemKey)) { CatalogBookItemModel = TransientStorage.Get <CatalogBookItemModel>(CatalogBookItemKey); } _thisBookBookmarksViewModel.BookId = BookId; _thisBookBookmarksViewModel.CatalogId = CatalogId; _thisBookBookmarksViewModel.CatalogBookItemModel = CatalogBookItemModel; Items.Add(_thisBookBookmarksViewModel); Items.Add(_allBooksBookmarksViewModel); }
private async Task CheckForDownloadItem(string url) { var link = await GetDownloadLink(url); if (link != null) { if (!string.IsNullOrEmpty(CatalogBookItemKey) && TransientStorage.Contains(CatalogBookItemKey)) { var catalogBookItem = TransientStorage.Get <CatalogBookItemModel>(CatalogBookItemKey); catalogBookItem.Links = new List <BookDownloadLinkModel> { link }; _navigationService .UriFor <BookInfoPageViewModel>() .WithParam(vm => vm.Title, catalogBookItem.Title.ToUpper()) .WithParam(vm => vm.Description, catalogBookItem.Description) .WithParam(vm => vm.ImageUrl, catalogBookItem.ImageUrl) .WithParam(vm => vm.CatalogId, CatalogId) .WithParam(vm => vm.StartDownload, true) .WithParam(vm => vm.CatalogBookItemKey, TransientStorage.Put(catalogBookItem)) .Navigate(); _navigated = true; } else { var catalogBookItemModel = new CatalogBookItemModel { Links = new List <BookDownloadLinkModel> { link }, Title = Title, Id = Guid.NewGuid().ToString() }; _downloadController.DownloadBook(catalogBookItemModel, CatalogId); _catalogItemId = catalogBookItemModel.Id; } } }
protected override void OnInitialize() { base.OnInitialize(); if (TransientStorage.Contains(CatalogBookItemKey)) { CatalogBookItemModel = TransientStorage.Get <CatalogBookItemModel>(CatalogBookItemKey); } if (!string.IsNullOrEmpty(BookId)) { InitializeBook(); } else { if (CatalogBookItemModel != null) { if (CheckIsDownloaded()) { return; } if (CheckForExistingTrial()) { InitializeBook(); } else { Title = !string.IsNullOrEmpty(CatalogBookItemModel.Title) ? CatalogBookItemModel.Title : null; Author = CatalogBookItemModel.Author; Description = CatalogBookItemModel.Description; IsBookFree = CatalogBookItemModel.AcquisitionLink == null; ApplicationBarIndex = 1; } } ShowOverlayIfBookDownloading(); } }
protected override void OnInitialize() { base.OnInitialize(); Book = _bookRepository.Get(BookId); if (Book == null) { _navigationService.GoBack(); return; } if (ToLastReadPage) { TokenOffset = Book.CurrentTokenID; } if (TransientStorage.Contains(CatalogBookItemKey)) { CatalogBookItemModel = TransientStorage.Get <CatalogBookItemModel>(CatalogBookItemKey); } UpdateIsFavouriteBook(); }