Esempio n. 1
0
        public async void LoadChartDataAsync()
        {
            LoadSpotlight();

            var rnd = new Random(DateTime.Now.Millisecond);

            try
            {
                IsMostStreamedLoading = true;
                var page = rnd.Next(0, 9) * 10;
                TopTracks = (await _spotify.GetMostStreamedTracksAsync()).Skip(page).Take(10).ToList();
            }
            catch
            {
                TopTracks = new List <ChartTrack>();
            }

            IsMostStreamedLoading = false;

            _service.AuthStateChanged += ServiceOnAuthStateChanged;
            if (_service.HasCredentials)
            {
                ServiceOnAuthStateChanged(null, new BoolEventArgs(true));
            }
        }