Closed jamesmontemagno closed 6 years ago
But if we want to enable it again, we've to render the page again!
I am still looking in to this, I haven't experienced this really, but need to test it out.
Hi there ! Same problem here on iOS and Android. It could be great if we can set this property to enable or disable "on the fly" the ability to pull to refresh!
We can disable individual ScrollViews recursively. Same way you added the ScrollViews in first place.
The problem is still open, activity indicator keeps on spinning right after setting IsRefreshing = false;
@aliuspetraska that would seem to be a different issue if it is so as this mentions IsPullToRefreshEnabled, not IsRefreshing, but have you done a data binding to IsRefreshing?
@aliuspetraska @jamesmontemagno I have the same issue. The indicator keeps spinning. Is there any solution for this problem?
Can someone create me a small repo of the bug please.
The problem is on iOS when setting IsRefreshing = false immediately after executing the refresh command it keeps spinning forever. For me it worked by adding a time delay of around one second or slowing down "loadData()".
` async Task ExecuteRefreshCommand() { if (IsBusy) return;
IsBusy = true;
//await loadData();
await Task.Delay(1000); // otherwise it´s spinning forever
IsBusy = false;
}`
@aliuspetraska @jamesmontemagno
I had this problem (spinner not stopping when setting the bounded, IsRefreshing, property to false).
I think that the components BindingMode.TwoWay does not work for the property IsRefreshing. I.e when pulling to refresh in the UI, the component does not update the IsRefreshing-property in the viewmodel. Since it is already false, when setting it to false again, the INotifyPropertyChange does not get triggered. And it keeps spinning.
I have not studied it in depth, so I'm not sure this is the issue.
However, when I now set the IsRefreshing-property to true, manually, in the RefreshCommand, it works when I set it to false, after the update.
@danielbigler had to do something similar as well thanks for the tip..!
As @Kricke242 correctly observed, the IsBusy property is still false when the refresh command is executed. So if the setter of this property does check for equality before sending INotifyPropertyChanged, setting it to false won't trigger UI updates. This is not conform the Pull to refresh functionality of the X.F ListView component. Setting it to true manually solved it, and probably just raising the NotifyPropertyChanged with the correct parameter, too.
@jamesmontemagno it looks like, if one uses VisualElement.IsEnabled
property instead of the IsPullToRefreshEnabled
property, it works on both Android and iOS as expected. The reason is that if you leave IsEnabled
as true
, the VisualElementTracker
uses this property and overrides yours IsPullToRefreshEnabled
.
Guys, what's a status of bug with IsPullToRefreshEnabled ? I've just added PullToRefresh nuget and there's still a problem with disabling refresh.
Instead of the delay, just calling OnPropertyChanged("IsBusy");
worked for me.
If you set IsPullToRefreshEnabled it doesn't seem to do anything. Quite possibly related to the following question on SO - http://stackoverflow.com/questions/19480424/how-do-i-hide-a-uirefreshcontrol
To disable, you need to fully remove the UIRefresh control, not simply set Enabled to false.
Moved from: https://github.com/jamesmontemagno/Xamarin.Forms-Awesome-Controls/issues/14