public async Task <PolandVehicleDetail> GetPolandVehicleDetailsByRequestIdAsync(string requestId, CancellationToken cancellationToken = default(CancellationToken)) => await Task.Run(async() => { PolandVehicleDetail polandVehicleDetail = null; string url = string.Format(BaseSingleton <GlobalSetting> .Instance.RestEndpoints.VehicleEndpoints.PolandVehicleDetailsByRequestIdEndpoint, requestId); string accessToken = BaseSingleton <GlobalSetting> .Instance.UserProfile.AccesToken; try { polandVehicleDetail = await _requestProvider.GetAsync <PolandVehicleDetail>(url, accessToken); } catch (ConnectivityException ex) { throw ex; } catch (ServiceAuthenticationException ex) { await _identityService.LogOutAsync(); throw ex; } catch (HttpRequestExceptionEx ex) { polandVehicleDetail = null; } catch (Exception ex) { Debug.WriteLine($"ERROR:{ex.Message}"); Debugger.Break(); } return(polandVehicleDetail); }, cancellationToken);
protected override void OnShowPopupCommand(object param) { base.OnShowPopupCommand(param); if (param is PolandVehicleDetail polandVehicleDetail) { _lastIncomingVechile = polandVehicleDetail; PlainOutputText = VEHICLE_FOUND_OUTPUT; } else { _lastIncomingVechile = null; PlainOutputText = NO_RESULTS_OUTPUT; } }
protected async override void OnIsPopupVisible() { base.OnIsPopupVisible(); if (!IsPopupVisible) { if (_lastIncomingVechile != null) { await NavigationService.NavigateToAsync <PolandDriveAutoDetailsViewModel>(_lastIncomingVechile); await NavigationService.RemoveIntermediatePagesAsync(); } else { await NavigationService.NavigateToAsync <MainViewModel>(); } _lastIncomingVechile = null; } }