示例#1
0
        public static ImageSource GetImageForPlayListItemCard(
            IFileService fileService,
            PlayListItemViewModel vm)
        {
            var existingImgPath = vm.Items
                                  .Select(f => fileService.GetFirstThumbnailFilePath(f.Name))
                                  .Distinct()
                                  .FirstOrDefault(fileService.Exists);

            return(GetImageForPlayListItem(fileService, existingImgPath));
        }
示例#2
0
        public static ImageSource GetImageForPlayListItemCard(
            IFileService fileService,
            string filename,
            string path,
            PlayListItemViewModel vm)
        {
            //If the item is not in the playlist, then try to return an image that is part of the playlist
            var exists = vm.Items.Any(f => f.Filename == filename);

            return(exists ? GetImageForPlayListItem(fileService, path) : GetImageForPlayListItemCard(fileService, vm));
        }