Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created March 31, 2012 04:55
Show Gist options
  • Select an option

  • Save anaisbetts/2259460 to your computer and use it in GitHub Desktop.

Select an option

Save anaisbetts/2259460 to your computer and use it in GitHub Desktop.
public class MainPageViewModel : ReactiveObject
{
ObservableAsPropertyHelper<BitmapImage> _OriginalImage;
public BitmapImage OriginalImage {
get { return _OriginalImage.Value; }
}
public ReactiveCommand TakePhoto { get; protected set; }
public MainPageViewModel()
{
TakePhoto = new ReactiveCommand();
var cameraUI = new CameraCaptureUI();
TakePhoto.SelectAsync(async x => await cameraUI.CaptureFileAsync(CameraCaptureUIMode.Photo))
.ObserveOn(RxApp.DeferredScheduler)
.Select(x => new BitmapImage(new Uri(x.Path)))
.ToProperty(this, x => x.OriginalImage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment