I have a question. My activity Indicator dismisses before my images are finished loading from my api. Is it because the call to the api is async? If so, how can I make sure the call is done or the images are loaded on the screen before dismissing my activity indicator?
The activity indicator code in my XAML looks like this:
<ActivityIndicator IsRunning="{Binding IsBusy}"
IsVisible="{Binding IsBusy}"
VerticalOptions="Center"
HorizontalOptions="Center"/>
My property (which is located in viewmodel base):
private bool isBusy;
public bool IsBusy
{
get { return isBusy; }
set { SetProperty(ref isBusy, value); }
}
And this is the code where I set the property:
public override async void OnNavigatingTo(NavigationParameters navParams)
{
if(navParams.ContainsKey("query"))
{
var query = (string)navParams["query"];
IsBusy = true;
await DisplayImages(query);
IsBusy = false;
}
}
Thanks!