public SelfieDoc(string documentType, string applicationId) { var selfieViewModel = new SelfieViewModel(applicationId); selfieViewModel.LoadSelfie(null); selfieViewModel.Navigation = Navigation; BindingContext = selfieViewModel; InitializeComponent(); }
public void CapturePhoto() { var selfie = new SelfieViewModel { Selfie = InputObject.UserProfile.UserImage.Selfie }; photoRepo.SelectPictureFromGallery(InputObject.UserProfile.UserImage); }
public void SelectPictureFromGallery(SelfieViewModel model) { foreach (var service in _PlatformBonsai.GetBonsaiServices) { if (service.PlatformHarness.ServiceKey == "PhotoPicturePicker") { service.PlatformHarness.ServiceCallBack = addPlatformAction(model); service.PlatformHarness.Activate(); } } }
public async Task CapturePhotoAsync(SelfieViewModel model) { var photo = await Plugin.Media.CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions() { }); if (photo != null) { model.Selfie = await _ImageRepo.GetPhotoBinary(photo.GetStream()); _MasterRepo.DataSource.User.UserPicture = model.Selfie; await OfflineStorageRepository.Instance.UpdateRecordAsync(_MasterRepo.DataSource.User); } }
private Action <IPlatformModelBase> addPlatformAction(SelfieViewModel model) { async void modelAction(IPlatformModelBase photo) { var stream = ((IPhotoPicturePickerModel)photo).ImageStream; model.Selfie = await _ImageRepo.GetPhotoBinary(stream); } Action <string, IPlatformModelBase> pr = (serviceKey, photo) => { if (serviceKey.Equals("PhotoPicturePicker")) { modelAction(photo); } }; Action <string, IPlatformModelBase> PlatformAction = pr; _MasterRepo.OnPlatformServiceCallBack.Add(PlatformAction); return(modelAction); }
private Action <IPlatformModelBase> addPlatformAction(SelfieViewModel model) { Action <IPlatformModelBase> modelAction = async(photo) => { var stream = ((IPhotoPicturePickerModel)photo).ImageStream; model.Selfie = await _ImageRepo.GetPhotoBinary(stream); _MasterRepo.DataSource.User.UserPicture = model.Selfie; await OfflineStorageRepository.Instance.UpdateRecordAsync(_MasterRepo.DataSource.User); }; Action <string, IPlatformModelBase> pr = (serviceKey, photo) => { if (serviceKey.Equals("PhotoPicturePicker")) { modelAction(photo); } }; Action <string, IPlatformModelBase> PlatformAction = pr; _MasterRepo.OnPlatformServiceCallBack.Add(PlatformAction); return(modelAction); }