How to bind the value for activity indicator?

unknown123unknown123 Member ✭✭✭
edited June 14 in Xamarin.Forms

im Using an Activity Indicator in a ListView Footer because of huge records on the time of loading i want to show the activity indicator

My Xaml

<ListView.FooterTemplate>



</ListView.FooterTemplate>

My Cs:
public bool IsBusy
{
get { return isBusy; }
set
{
if (isBusy = value)
return;
isBusy=value;
OnPropertyChanged("IsBusy");
}
}

I want to bind the isBusy to my activity indicator to run and stop how can i achieve this ??

Posts

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    ActivityIndicator has some properties like IsRunning (if I remember correctly)

  • unknown123unknown123 Member ✭✭✭
    edited June 14

    Yes I want to bind IsBusy on activityIndicator isRunning

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    Bind it, which is the problem?

  • unknown123unknown123 Member ✭✭✭
    edited June 14

    When i running it by IsRunning = true it runs well
    but im binding the value to IsRunning it doesnt works.
    <ListView.FooterTemplate> <DataTemplate> <ActivityIndicator Margin="0, 5" IsRunning="True" IsVisible="True" Color="Gray" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" /> </DataTemplate> </ListView.FooterTemplate>

  • Amar_BaitAmar_Bait DZMember ✭✭✭✭✭

    Did you try this?

    <ActivityIndicator Margin="0, 5" IsRunning="{Binding IsBusy}" IsVisible="True" Color="Gray" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" />
    
  • GanesanVGGanesanVG INMember ✭✭
    edited June 22
    Try to make your codes into ListView.Footer instead of ListView.FooterTemplate.
  • GanesanVGGanesanVG INMember ✭✭

    Like this,

    <ListView.Footer> <ActivityIndicator Margin="0, 5" IsRunning="True" IsVisible="True" Color="Gray" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" /></ListView.Footer>

Sign In or Register to comment.