Example #1
0
        private async Task PlaySong()
        {
            var    list = SongList.Where(s => s.GameMark == null);
            Random rdm  = new Random();
            int    r    = rdm.Next(list.Count());

            CurrentSong = list.ElementAt(r);
            var file = await StorageFile.GetFileFromPathAsync(CurrentSong.UriStr);

            SongPlayer.SetSource(await file.OpenReadAsync(), file.ContentType);
            CurrentSong.GameMark = false;
        }