The code works with the normal but not with FFImageLoading. The ActivityIndicator is not displaying... What am I doing wrong?
<ContentPage.Content>
<StackLayout>
<local:PinchPanContainer>
<local:PinchPanContainer.Content HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<ffimageloading:CachedImage RetryCount="5" RetryDelay="1" CacheDuration="1" x:Name="MyImage" HorizontalOptions="Fill" VerticalOptions="CenterAndExpand" DownsampleToViewSize="False"></ffimageloading:CachedImage>
</local:PinchPanContainer.Content>
</local:PinchPanContainer>
<ActivityIndicator BindingContext="{x:Reference MyImage}" IsRunning="{Binding CachedImage.IsLoading}" IsVisible="{Binding CachedImage.IsLoading}"/>
</StackLayout>
</ContentPage.Content>
The binding path you use is not correct, it should be IsLoading
instead of CachedImage.IsLoading
:
<StackLayout>
<ffimageloading:CachedImage Source="http://img1.wikia.nocookie.net/__cb20101219155130/uncyclopedia/images/7/70/Facebooklogin.png" LoadingDelay="2000" RetryCount="5" RetryDelay="1" CacheDuration="1" x:Name="MyImage" HorizontalOptions="Fill" VerticalOptions="CenterAndExpand" DownsampleToViewSize="False"></ffimageloading:CachedImage>
<ActivityIndicator BindingContext="{x:Reference MyImage}" Color="Red" IsRunning="{Binding IsLoading}" IsVisible="{Binding IsLoading}"/>
</StackLayout>
Refer: data-binding-basics