void FavoriteSectionItem_ItemClike(object sender, ItemClickEventArgs e)
        {
            FavourVolume item = (FavourVolume)e.ClickedItem;

            this.Frame.Navigate(typeof(ReadingPage), new NovelPositionIdentifier {
                VolumeId = item.VolumeId
            }.ToString());
        }
Exemplo n.º 2
0
        public async Task <bool> AddUserFavriteAsync(Volume vol, string seriesTitle = null)
        {
            if (FavoriteList == null)
            {
                return(false);
            }
            if (FavoriteList.Any(fav => fav.VolumeId == vol.Id))
            {
                return(true);
            }
            try
            {
                var result = await LightKindomHtmlClient.AddUserFavoriteVolume(vol.Id);

                if (!result)
                {
                    return(false);
                }
                FavourVolume favol = new FavourVolume
                {
                    VolumeId      = vol.Id,
                    FavId         = null,
                    VolumeNo      = vol.VolumeNo.ToString(),
                    CoverImageUri = vol.CoverImageUri,
                    Description   = vol.Description,
                    VolumeTitle   = vol.Title,
                    SeriesTitle   = seriesTitle,
                    FavTime       = DateTime.Now.AddSeconds(-5)
                };
                FavoriteList.Add(favol);
                CachedClient.UpdateCachedUserFavoriteVolumes(FavoriteList);
                return(true);
            }
            catch (Exception exception)
            {
                Debug.WriteLine("Error : Failed to Add User Favorite : " + exception.Message);
            }
            return(false);
        }