コード例 #1
0
ファイル: Tiles.cs プロジェクト: malliina/musicpimp-win
        private async Task <IList <Uri> > GetImageCollection()
        {
            var images = await Covers.GetCoverCollection(count : 5);

            if (images.Count == 0)
            {
                images.Add(DefaultImageUri);
            }
            return(images);
        }
コード例 #2
0
        /// <summary>
        /// Sets a random album cover as the app background. Opacity 0.1. Does nothing if
        /// an album cover cannot be found.
        /// </summary>
        /// <returns>a Uri to the background which was set, if any, otherwise null</returns>
        public async Task <Uri> SetRandomBackground()
        {
            var covers = await Covers.GetCoverCollection(20);

            if (covers.Count > 0)
            {
                var uri = covers.Head();
                await SetBackground(uri);

                return(uri);
            }
            return(null);
        }