private async void LoadBackgroundImage() { if ((AppUser.Instance.BackgroundWallpapersEnabled || (AppUser.Instance.ImagesWithWIFI && StorageController.IsConnectedToWifi()))) { this.ShowPanorama.Background = new ImageBrush { ImageSource = await showController.getFanartImage(this.Show.tvdb_id, this.Show.Images.Fanart), Opacity = 0.0, Stretch = Stretch.UniformToFill, }; Animation.ImageFadeIn(this.ShowPanorama.Background); } }
public async void ShowWatchingNowShow(TraktEpisode episode, TraktShow show, DateTime watchTime) { this.WatchingNowGrid.Visibility = System.Windows.Visibility.Visible; this.LayoutRoot.Background = new ImageBrush { ImageSource = await showController.getFanartImage(show.tvdb_id, show.Images.Fanart), Opacity = 0.0, Stretch = Stretch.UniformToFill, }; App.ViewModel.clearWatching(); this.WatchingNowGrid.Visibility = System.Windows.Visibility.Visible; ListItemViewModel model = new ListItemViewModel() { Type = "episode", Year = show.year, Name = show.Title, ImageSource = episode.Images.Screen, Imdb = show.tvdb_id + episode.Season + episode.Number, SubItemText = "Season " + episode.Season + ", Episode " + episode.Number, Episode = episode.Number, Season = episode.Season, Tvdb = show.tvdb_id, Watched = episode.Watched, Rating = episode.MyRatingAdvanced, InWatchList = episode.InWatchlist }; model.LoadScreenImage(); TimeSpan percentageCompleteTimeSpan = DateTime.UtcNow - watchTime; model.WatchedCompletion = ((Double)percentageCompleteTimeSpan.TotalMinutes / (Double)(show.Runtime)) * 100; if (Double.IsInfinity(model.WatchedCompletion)) { model.WatchedCompletion = 0; } App.ViewModel.WatchingNow = model; if (this.LayoutRoot.Background != null) { Animation.ImageFadeIn(this.LayoutRoot.Background); } Deployment.Current.Dispatcher.BeginInvoke(new Action(() => { App.ViewModel.NotifyPropertyChanged("WatchingNow"); })); }