private async void LoadWatchlist() { TraktShow[] myShows = await controller.getUserWatchlist(); List <String> seenShows = new List <string>(); Dictionary <String, TraktShowProgress> progressDictionary = new Dictionary <string, TraktShowProgress>(); if (fullprogress != null) { foreach (TraktShowProgress progress in fullprogress) { if (!progressDictionary.ContainsKey(progress.Show.tvdb_id)) { progressDictionary.Add(progress.Show.tvdb_id, progress); } if (progress.Progress.Percentage == 100) { seenShows.Add(progress.Show.tvdb_id); } } } ObservableCollection <ListItemViewModel> tempItems = new ObservableCollection <ListItemViewModel>(); foreach (TraktShow show in myShows) { tempItems.Add(new ListItemViewModel() { Name = show.Title, ImageSource = show.Images.Poster, Imdb = show.imdb_id, Tvdb = show.tvdb_id, SubItemText = show.year.ToString(), Genres = show.Genres, Progress = progressDictionary.ContainsKey(show.tvdb_id) ? progressDictionary[show.tvdb_id].Progress.Percentage : Int16.Parse("0"), ProgressText = progressDictionary.ContainsKey(show.tvdb_id) ? progressDictionary[show.tvdb_id].Progress.Left + " episodes left to see!" : "Can't fetch unseen episodes :-(" }); } if (tempItems.Count == 0) { tempItems.Add(new ListItemViewModel() { Name = "Nothing Found" }); } this.LoadingMyShows = false; System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => { this.ShowItems = AlphaKeyGroup <ListItemViewModel> .CreateGroups(tempItems, Thread.CurrentThread.CurrentUICulture, (ListItemViewModel s) => { return(s.Name); }, true); App.MyShowsViewModel.NotifyPropertyChanged("ShowItems"); if (this.Indicator != null) { this.Indicator.IsVisible = false; } }); }