private void OnRemovePhotoException(object sender, RemovePhotoFromSetExceptionEventArgs e)
        {
            Dispatcher.BeginInvoke(() => {
                if (e.PhotoId != currentProcessinPhotoId)
                    return;

                currentProcessinPhotoId = null;
                PhotoListView.Opacity = 1;
                PhotoListView.IsEnabled = true;

                ThrottleProgressBar.Visibility = Visibility.Collapsed;
                ThrottleLabel.Foreground = errorMessageBrush;
                ThrottleLabel.Text = e.ErrorMessage;

                // Revert renderer
                var evt = new PhotoPickerRendererEventArgs();
                evt.PhotoId = e.PhotoId;
                evt.Selected = true;
                PhotoPickerRenderer.PhotoSourceSelectionStateChanged(this, evt);
            });
        }
        private void OnPhotoSourceSelectionStateChanged(object sender, PhotoPickerRendererEventArgs e)
        {
            if (PhotoSource.PhotoSource.ResourceId != e.PhotoId)
                return;

            PhotoSource.Selected = e.Selected;
            UpdateSelectionState();
        }
 private void OnPhotoPickerToggled(object sender, PhotoPickerRendererEventArgs e)
 {
     // Add or delete photo
     if (e.Selected)
     {
         AddPhotoToSet(e.PhotoId);
     }
     else
     {
         RemovePhotoFromSet(e.PhotoId);
     }
 }
 private void DispatchSelectionEvent()
 {
     // Dispach event
     if (SelectionChanged != null)
     {
         var evt = new PhotoPickerRendererEventArgs();
         evt.PhotoId = PhotoSource.PhotoSource.ResourceId;
         evt.Selected = PhotoSource.Selected;
         SelectionChanged(this, evt);
     }
 }