We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

BusyIndicator does not stop after loading document from internet

Using BusyIndicator to load a doc from internet

The indicator starts but does not stop and does not hide.

What do i have to change ?

My code 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Syncfusion.SfBusyIndicator.XForms;
namespace Ouderijn
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class Web : ContentPage
    {
        public Web()
        {
            InitializeComponent();
           
            base.OnAppearing();
            
        }
        protected async void webOnNavigating(object sender, WebNavigatingEventArgs e)
        {
            SfBusyIndicator busyIndicator = new SfBusyIndicator();
            busyindicator.IsVisible = true;
            busyindicator.IsBusy = true;
            await Task.Delay(2000);

            if (e.Url.Contains(".pdf"))
            {
                // Retrieving the URL  

                var pdfUrl = new Uri(e.Url);
                busyindicator.IsBusy = false;
                busyindicator.IsVisible = false;

                // Open PDF URL with device browser to download  

                Device.OpenUri(pdfUrl);

                // Cancel the navigation on click actions   
                // (retains in the same page.)  

                e.Cancel = true;
               
            }
        }
    }
}

5 Replies

HM Hemalatha Marikumar Syncfusion Team October 18, 2019 05:28 PM UTC

Hi Boris,

Greetings from Syncfusion. 
 
We have checked the provided code snippet and setting false to IsBusy property of SfBusyIndicator is enough to disappear it. We have suspected that due to the condition failed on the below code  
 
e.Url.Contains(".pdf") 
 
IsBusy and IsVisible may not set as false. From the provided code snippet, we have prepared the sample which can be downloaded from below 
protected async void webviewNavigated(object sender, WebNavigatedEventArgs e) 
            if (e.Url.Contains(".pdf")) 
            { 
                var pdfUrl = new Uri(e.Url); 
                busyindicator.IsBusy = false; 
                busyindicator.IsVisible = false; 
                this.labelLoading.IsVisible = true; 
                Device.OpenUri(pdfUrl); 
            } 
            else 
            { 
             //else condition works 
                busyindicator.IsBusy = false; 
                busyindicator.IsVisible = false; 
                this.labelLoading.IsVisible = true; 
            } 
 } 


 
Since we unaware of your exact scenarios, we were unable to reproduce the reported issue. If the reported issue persists, please update us with modified sample and replication procedure to check it further and provide a better solution.  
 
Regards, 
Hemalatha M. 



BO Boris Oprit October 21, 2019 05:52 PM UTC

Thanks


HM Hemalatha Marikumar Syncfusion Team October 22, 2019 05:40 AM UTC

Hi Boris, 
 
Thanks for your update. 
 
Please let us know if you have any other query. 
 
Regards, 
Hemalatha M. 



DA David September 24, 2021 12:40 PM UTC

I  have the same situation where the indiciator is always animating and visible does not disapear.



SS Suganya Sethuraman Syncfusion Team September 27, 2021 07:59 AM UTC

Hi David,

Greetings from Syncfusion.

We have analyzed your query. To change the visibility of SfBusyIndicator, we recommend that you use the IsBusy and IsEnable APIs.

Please have a sample for your reference, when we click the “Change IsBusy” button in this sample, the SfBusyIndicator disappears.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/BusySample-1389660707

Please check if the sample satisfies your requirement and let us know if you have any concerns.

Regards,
Suganya Sethuraman.
 


Loader.
Live Chat Icon For mobile
Up arrow icon