Channel9Downloader.ViewModels.Dashboard.DashboardVM.InitializeLatestVideosAsync C# (CSharp) Méthode

InitializeLatestVideosAsync() private méthode

Initializes the latest videos in the background.
private InitializeLatestVideosAsync ( TaskScheduler continuationTaskScheduler ) : void
continuationTaskScheduler System.Threading.Tasks.TaskScheduler The main thread scheduler.
Résultat void
        private void InitializeLatestVideosAsync(TaskScheduler continuationTaskScheduler)
        {
            IsAdornerVisible = true;
            var latestVideos = new List<RssItem>();
            var task = new Task(() =>
            {
                latestVideos = _rssRepository.GetRssItems();
            });

            task.ContinueWith(
                x =>
                {
                    LatestVideos = new ObservableCollection<RssItem>(latestVideos);
                    IsAdornerVisible = false;
                    CommandManager.InvalidateRequerySuggested();
                },
                continuationTaskScheduler);

            task.Start();
        }