Example #1
0
        /// <summary>
        /// Submits the task.
        /// </summary>
        public void SubmitTask()
        {
            if (IsRequesting)
            {
                return;
            }

            IsRequesting = true;

            var task = _task.Invoke();

            CoreService.ExecuteTaskAsync(task, HandleException).ContinueWith((_) =>
            {
                if (task.IsCompletedSuccessfully)
                {
                    _response = task.Result;

                    RawResponse = _response.RawResponse;

                    PropertyTitle = CalculatePropertyTitle();
                    SuccessTitle  = CalculateSuccessTitle();
                    ValueTitle    = CalculateValueTitle();
                }

                IsRequesting = false;
            });
        }
        private void ApkAuthorize()
        {
            if (_isLoading)
            {
                return;
            }

            _isLoading = true;

            var success = false;

            MessagingService.Instance.ShowLoadingAsync(new LoadingAsyncConfig
            {
                Message = Resources.MessagingConnecting
            }, CoreService.ExecuteTaskAsync(CoreService.CamClient.AdminOperations.ApkAuthorizeAsync, (response) =>
            {
                if (response is ResponseEntity apkAuthorization && apkAuthorization.Success)
                {
                    success = true;

                    _navigationService.Navigate <ActionsViewModel, ActionsViewModelNavigationParams>(new ActionsViewModelNavigationParams
                    {
                        DashCamActions = new MaiActions(CoreService, _navigationService)
                    });
                }
            })).ContinueWith((task) =>
        /// <summary>
        /// Submits the task.
        /// </summary>
        public void SubmitTask()
        {
            if (IsRequesting)
            {
                return;
            }

            IsRequesting = true;

            CoreService.ExecuteTaskAsync(_task.Invoke, (response) =>
            {
                _response = response;

                RawResponse = _response.RawResponse;

                PropertyTitle = CalculatePropertyTitle();
                SuccessTitle  = CalculateSuccessTitle();
                ValueTitle    = CalculateValueTitle();
            }, HandleException).ContinueWith((task) =>
            {
                IsRequesting = false;
            });
        }
        private void ApkAuthorize()
        {
            if (_isLoading)
            {
                return;
            }

            _isLoading = true;

            var task = CoreService.CamClient.AdminOperations.ApkAuthorizeAsync();

            MessagingService.Instance.ShowLoadingAsync(new LoadingAsyncConfig
            {
                Message = Resources.MessagingConnecting
            }, CoreService.ExecuteTaskAsync(task)).ContinueWith((_) =>
            {
                if (task.IsCompletedSuccessfully && task.Result is ResponseEntity apkAuthorization && apkAuthorization.Success)
                {
                    _navigationService.Navigate <ActionsViewModel, ActionsViewModelNavigationParams>(new ActionsViewModelNavigationParams
                    {
                        DashCamActions = new MaiActions(CoreService, _navigationService)
                    });
                }