I have a RefreshView in a page. I want the data to refresh the first time it is shown, so I have this:
protected override void OnAppearing()
{
if(!_hasRefreshedFirstTime) {
_hasRefreshedFirstTime = true;
TypedContext.IsRefreshing = true;
}
}
And in my view model the refresh command is the following, with Refresh = new AsyncCommand(DoRefresh, onException: exceptionHandler);:
public IAsyncCommand Refresh { get; }
private async Task DoRefresh()
{
IsRefreshing = true;
_ = await DataManager.RefreshOrderHistoryAsync();
IsRefreshing = false;
}
This works, but this first time it is refreshing the ActivityIndicator is frozen. Interestingly, after that, if I pull to refresh, the indicator animates correctly.
My question is, why in the indicator not animated correctly and how can I fix that?
