async Task GetPayLink(string ident, decimal sum, bool isInsurance) { if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet) { Device.BeginInvokeOnMainThread(async() => await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK")); return; } Configurations.LoadingConfig = new LoadingConfig { IndicatorColor = (Color)Application.Current.Resources["MainColor"], OverlayColor = Color.Black, Opacity = 0.8, DefaultMessage = AppResources.Loading, }; await Loading.Instance.StartAsync(async progress => { PayService payLink = await server.GetPayLink(ident, sum, isInsurance); if (payLink.payLink != null) { Device.BeginInvokeOnMainThread(async() => webView.Source = payLink.payLink); } else { Device.BeginInvokeOnMainThread(async() => { await DisplayAlert(AppResources.ErrorTitle, payLink.Error, "OK"); try { _ = await Navigation.PopAsync(); } catch { } }); } }); }