Пример #1
0
        private async Task LoadAlbumImage()
        {
            if (!_albumChangedHandlerAdded)
            {
                ThumbnailManager.OnAlbumImageChanged(_tag.ArtistName, _tag.AlbumName, OnAlbumImageChanged);
                _albumChangedHandlerAdded = true;
            }

            var(image, filePresent) = await ThumbnailManager.GetAsync(
                _tag.ArtistName,
                _tag.AlbumName,
                (int)Math.Max(
                    Math.Ceiling(ActualWidth),
                    Math.Ceiling(ActualHeight)));

            if (filePresent)
            {
                if (image == null)
                {
                    await FallbackMoveNext();
                }
                else
                {
                    await AnimatedSetThumbnailSource(image);
                }
            }
            else
            {
                //LoadLastFallback();
                ThumbnailAgent.Fetch(_tag.ArtistName, _tag.AlbumName, _tag.ThumbnailPath);
            }
        }