Beispiel #1
0
        private async void UpdateDisplay(TrackDetails track)
        {
            if (!Dispatcher.CheckAccess())
            {
                await Dispatcher.BeginInvoke(new Action(() => UpdateDisplay(track)));

                return;
            }

            currentTrack          = track;
            TrackTitle.Text       = track?.Name ?? "No track";
            TrackArtist.Text      = track?.Artist ?? string.Empty;
            TrackImage.Source     = (await api.GetAlbumArtAsync(AlbumArtSize.Size160)).ToBitmapSource();
            TrackProgress.Maximum = track?.Length.TotalMilliseconds ?? 0;
        }