private void OnPhotoAddedToGroup(object sender, AddPhotoToGroupCompleteEventArgs e) { Dispatcher.BeginInvoke(() => { if (e.GroupId != Group.ResourceId) return; StatusLabel.Visibility = Visibility.Collapsed; PhotoStreamListView.Visibility = Visibility.Visible; Photo newPhoto = Cinderella.CinderellaCore.PhotoCache[e.PhotoId]; List<PhotoGroup> photoGroups = rendererFactory.GeneratePhotoGroups(new List<Photo> { newPhoto }); foreach (var group in photoGroups) { PhotoCollection.Insert(0, group); } }); }
private void OnAddPhotoCompleted(object sender, AddPhotoToGroupCompleteEventArgs e) { Dispatcher.BeginInvoke(() => { if (e.PhotoId != currentProcessinPhotoId) return; currentProcessinPhotoId = null; PhotoListView.Opacity = 1; PhotoListView.IsEnabled = true; ThrottleProgressBar.Visibility = Visibility.Collapsed; ThrottleLabel.Foreground = normalMessageBrush; UpdateThrottleLabel(); SelectedPhotos.Add(e.PhotoId); }); }
private void OnPhotoAddedToGroup(object sender, AddPhotoToGroupEventArgs e) { // Update group throttle info FlickrGroup group = GroupCache[e.GroupId]; Photo photo = PhotoCache[e.PhotoId]; if (group.ThrottleMode != "none") group.ThrottleRemainingCount--; if (!group.Photos.Contains(photo)) { group.Photos.Insert(0, photo); group.PhotoCount++; // Dispatch event AddPhotoToGroupCompleteEventArgs ae = new AddPhotoToGroupCompleteEventArgs(); ae.PhotoId = photo.ResourceId; ae.GroupId = group.ResourceId; AddPhotoToGroupCompleted.DispatchEvent(this, ae); } }