예제 #1
0
        private async void Thumbnail_OnLoaded(object sender, RoutedEventArgs e)
        {
            var dataContext = sender.GetDataContext <Illustration>();

            if (dataContext != null && Uri.IsWellFormedUriString(dataContext.Thumbnail, UriKind.Absolute))
            {
                UiHelper.SetImageSource(sender, await PixivEx.GetAndCreateOrLoadFromCacheInternal(dataContext.Thumbnail, dataContext.Id));
            }

            UiHelper.StartDoubleAnimationUseCubicEase(sender, "(Image.Opacity)", 0, 1, 500);
        }
예제 #2
0
        private async void UserPrevItem_OnLoaded(object sender, RoutedEventArgs e)
        {
            var(avatar, thumbnails) = GetUserPrevImageControls(sender);
            var dataContext = sender.GetDataContext <User>();

            UiHelper.SetImageSource(avatar, await PixivEx.GetAndCreateOrLoadFromCacheInternal(dataContext.Avatar, dataContext.Name));

            var counter = 0;

            foreach (var thumbnail in thumbnails)
            {
                if (counter < dataContext.Thumbnails.Length)
                {
                    UiHelper.SetImageSource(thumbnail, await PixivEx.GetAndCreateOrLoadFromCacheInternal(dataContext.Thumbnails[counter], $"{dataContext.Id}", counter++));
                }
            }
        }
예제 #3
0
        private async void SetIllustratorAvatar(string id)
        {
            var userInfo = await HttpClientFactory.AppApiService.GetUserInformation(new UserInformationRequest { Id = id });

            UiHelper.SetImageSource(IllustratorAvatar, await PixivEx.GetAndCreateOrLoadFromCacheInternal(userInfo.UserEntity.ProfileImageUrls.Medium, $"{userInfo.UserEntity.Id}_avatar"));
        }
예제 #4
0
        private async void SpotlightThumbnail_OnLoaded(object sender, RoutedEventArgs e)
        {
            var dataContext = sender.GetDataContext <SpotlightArticle>();

            UiHelper.SetImageSource((Image)sender, await PixivEx.GetAndCreateOrLoadFromCacheInternal(dataContext.Thumbnail, dataContext.Id.ToString()));
        }