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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

BusyIndicator does not stop after loading document from internet

Thread ID:

Created:

Updated:

Platform:

Replies:

148397 Oct 17,2019 05:38 PM UTC Oct 22,2019 05:40 AM UTC Xamarin.Forms 3
loading
Tags: SfBusyIndicator
Boris Oprit
Asked On October 17, 2019 05:38 PM UTC

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;
               
            }
        }
    }
}

Hemalatha Marikumar [Syncfusion]
Replied On 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. 


Boris Oprit
Replied On October 21, 2019 05:52 PM UTC

Thanks

Hemalatha Marikumar [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon