Created
March 31, 2012 04:55
-
-
Save anaisbetts/2259460 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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