コード例 #1
0
ファイル: SelfieDoc.xaml.cs プロジェクト: jhonheve/FluidApp
        public SelfieDoc(string documentType, string applicationId)
        {
            var selfieViewModel = new SelfieViewModel(applicationId);

            selfieViewModel.LoadSelfie(null);
            selfieViewModel.Navigation = Navigation;
            BindingContext             = selfieViewModel;
            InitializeComponent();
        }
コード例 #2
0
        public void CapturePhoto()
        {
            var selfie = new SelfieViewModel
            {
                Selfie = InputObject.UserProfile.UserImage.Selfie
            };

            photoRepo.SelectPictureFromGallery(InputObject.UserProfile.UserImage);
        }
コード例 #3
0
 public void SelectPictureFromGallery(SelfieViewModel model)
 {
     foreach (var service in _PlatformBonsai.GetBonsaiServices)
     {
         if (service.PlatformHarness.ServiceKey == "PhotoPicturePicker")
         {
             service.PlatformHarness.ServiceCallBack = addPlatformAction(model);
             service.PlatformHarness.Activate();
         }
     }
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }