Forum Xamarin.iOS

ActivityIndacor in a Thread

kaanakyalcin.2185kaanakyalcin.2185 USMember ✭✭
edited January 2017 in Xamarin.iOS

Hi guys,

I try to get some datas from a webservice when page is opening.
Also try to show an activity indactor when thread works.

But i could'nt find any sample for this.

Could you help me about sample or code:)


  • KolaMounikaKolaMounika USMember ✭✭✭


    Try to create a IsBusy property in your ViewModel

       private bool _isBusy;
       public bool IsBusy
          get { return _isBusy; }
              _isBusy = value;

    and bind IsBusy to ActivityIndicator in XAML

                           IsVisible="{Binding IsBusy}"
                           IsRunning="{Binding IsBusy}"/>

    in the thread that your are trying to get data from web service set IsBusy like below

          IsBusy = true;
          //Your code to get data 
     catch (Exception exception)
           IsBusy = false;
Sign In or Register to comment.