Beispiel #1
0
        private async void StartAcquisitionCommandExecute()
        {
            if (_selectedAcquisitionMode.GetSystemMode() == CameraSystemMode.Record)
            {
                //await _cameraAcquisitionService.StartVideoRecord().ContinueWith((task) =>
                //   {
                //       _appStatus = CamereAppStatus.Recording;
                //       UpdateVisualState();
                //   }, TaskContinuationOptions.ExecuteSynchronously);

                var res = await _cameraAcquisitionService.StartVideoRecord();
                if (res.Success)
                {
                    _appStatus = CamereAppStatus.Recording;
                    UpdateVisualState();
                }
                else
                {
                    //TODO show error
                }
            }
            else
            {
                var res = await _cameraAcquisitionService.CapturePhoto(_selectedAcquisitionMode.GetCaptureMode());
                if (res.Success)
                {
                    //Todo
                    //_appStatus = CamereAppStatus.;
                    //UpdateVisualState();
                }
                else
                {
                    //TODO show error
                }
            }
        }
Beispiel #2
0
        public void OnNavigatedTo(object navigationParameter, System.Windows.Navigation.NavigationMode navigationMode, Dictionary<string, object> viewModelState)
        {
            // throw new NotImplementedException();
           
            if (navigationMode == System.Windows.Navigation.NavigationMode.New)
            {
                CameraState camState = _cameraStateRepository.GetCurrentCameraState();
                AvailableAcquisitionMode = Helpers.EnumToList<CameraAppAcquisitionMode>();
                _appStatus = camState.AppStatus;
                _selectedAcquisitionMode = camState.AppAcquisitionMode;
                UpdateVisualState();

                _eventAggregator.GetEvent<CameraSystemModeChangedEvent>().Subscribe((mode) =>
                {
                   UpdateSelectedAcquisitionMode( _cameraStateRepository.GetCurrentCameraState().AppAcquisitionMode);
                   UpdateVisualState();
                }, ThreadOption.UIThread);
            }            
        }
Beispiel #3
0
 private async void StopAcquisitionCommandExecute()
 {
     if (_selectedAcquisitionMode.GetSystemMode() == CameraSystemMode.Record)
     {
         var res = await _cameraAcquisitionService.StopVideoRecord();
         _appStatus = CamereAppStatus.Vf;
         UpdateVisualState();
     }
 }