Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Progress Bar only works if i use a Delay

$
0
0

Good Day

i am a Loading Page functionality that is defined here https://github.com/UdaraAlwis/Xamarin-Playground/tree/master/XFLoadingPageService . The loading Diaolog only show if i use

await Task.Delay(2000);

my code looks like this

 private async void btnstart_Clicked(object sender, EventArgs e)
        {
            DependencyService.Get<ILodingPageService>().InitLoadingPage(new LoadingIndicatorPage2());
            DependencyService.Get<ILodingPageService>().ShowLoadingPage();

            data .data obj = new data .data ();
            try
            {
                lblstatus.Text = "Before the call";
                // just to showcase a delay...
               // await Task.Delay(2000);

                    var lstentities = await obj.FindPerson_Report_Basic("81248877");

                lblstatus.Text = "After the call";
            }
            catch (Exception ex)
            {
                await DisplayAlert("Error:", ex.Message, "Ok");
            }
            finally
            {
                obj = null;
                DependencyService.Get<ILodingPageService>().HideLoadingPage();
            }
        }

but the loading page does not load , as you can see i commented the Delay part.

Thanks


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>