void photos_getFailed(ArtistPhotos sender) { myProgress.IsIndeterminate = false; myProgress.Value = 0; myProgress.Opacity = 0; NavigationService.GoBack(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { myProgress.Opacity = 1; myProgress.IsIndeterminate = true; //artist string Type = NavigationContext.QueryString["type"]; if (Type == "artist") { ArtistPhotos photos = new ArtistPhotos(); photos.getFailed += photos_getFailed; photos.getCompleted += photos_getCompleted; photos.get(NavigationContext.QueryString["ID"]); } else if (Type == "movie") { MoviePhotos movies = new MoviePhotos(); movies.getFailed += movies_getFailed; movies.getCompleted += movies_getCompleted; movies.get(NavigationContext.QueryString["ID"]); } base.OnNavigatedTo(e); }
void photos_getCompleted(ArtistPhotos sender) { if (sender.fotolar.Count == 0) { MessageBox.Show("Oyuncuya ait fotoğraf albümü mevcut değil."); NavigationService.GoBack(); return; } fotolar = sender.fotolar.Take(20).ToList(); foreach (string item in fotolar) { PivotItem NewPivotItem = new PivotItem(); NewPivotItem.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; NewPivotItem.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; NewPivotItem.Margin = new Thickness(0); asyncImage IMG = new asyncImage(); IMG.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; IMG.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; IMG.Margin = new Thickness(0); NewPivotItem.Content = IMG; PhotoPivot.Items.Add(NewPivotItem); IMG.Tag = item; } asyncImage FirstOne = ((asyncImage)((PivotItem)PhotoPivot.Items[0]).Content); FirstOne.FullURL = FirstOne.Tag as string; myProgress.IsIndeterminate = false; }