-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PullToRefreshLayout - Refresher does not hide after set IsRefreshing to false #49
Comments
I faced the same issue. I think it's because the IsRefreshing property does not recognize an immediate reset of the current value.
|
Would need a sample app to see what your issue is. |
In my case, it was resolved by using Device.BeginInvokeOnMainThread: |
Same issue here, I am using PullToRefreshLayout in the same situation as @viniciusmaia describes. |
There is definitely something up with the IsRefreshing property. In my case I am only able to update it if I directly reference the control. On Android Xaml
Codebehind
|
Even though I am not a fan of using the MessagingCenter to message from the viewmodel class to the code-behind, I get around the IsRefreshing bug in this way. I used the MainThread class in the Xamarin.Essentials package like below. HomeViewModel.cs HomePage.xaml.cs |
I'm facing the same problem: XAML: <ptr:PullToRefreshLayout IsPullToRefreshEnabled="{Binding Path=CloudService.IsReachable}"
RefreshCommand="{Binding Path=RefreshMasterDataCommand}"
IsRefreshing="{Binding Path=MasterDataIsRefreshing}">
<ScrollView>
<!-- some stuff -->
</ScrollView>
</ptr:PullToRefreshLayout> ViewModel: class MyVM : INotifyPropertyChanged
{
DelegateCommand _refreshMasterDataCommand;
public DelegateCommand RefreshMasterDataCommand => _refreshMasterDataCommand ?? (_refreshMasterDataCommand = new DelegateCommand(OnRefreshMasterDataExecuted));
void OnRefreshMasterDataExecuted()
{
MasterDataIsRefreshing = true;
NavigateAsync($"{nameof(Views.MasterDataUpdateModalPage)}", useModalNavigation: true);
MasterDataIsRefreshing = false;
}
public bool MasterDataIsRefreshing { get; set; }
} OnPropertyChanged is implemented using PropertyChanged.Fody and works fine for all other Properties. ViewModel (even not working): class MyVM : INotifyPropertyChanged
{
DelegateCommand _refreshMasterDataCommand;
public DelegateCommand RefreshMasterDataCommand => _refreshMasterDataCommand ?? (_refreshMasterDataCommand = new DelegateCommand(OnRefreshMasterDataExecuted));
void OnRefreshMasterDataExecuted()
{
MasterDataIsRefreshing = true;
NavigateAsync($"{nameof(Views.MasterDataUpdateModalPage)}", useModalNavigation: true);
MainThread.BeginInvokeOnMainThread(() => MasterDataIsRefreshing = false);
}
public bool MasterDataIsRefreshing { get; set; }
} |
same problem here |
Same problem :-) |
Same issue and same fix as above |
I've used the layout in multiple views in our project. The same problem occurs only on one view, on the others everything works as expected. But I wasn't able yet to determine what is causing the issue. Note: the "BeginInvokeOnMainThread"-Fix worked for me too! |
First I thought it is because the binding mode issue. So we cannot change value and let it propagate from view controller to layout itself. I modified the code like this:
However it doesn't work (it should but I could figure out why)
This is what I have done to make it works. |
Hello author, can you tell when this problem will be solved into NugetPackage? |
Can someone create an ultra simple fully working sample app that reproduces this behavior? |
Please use the RefreshView as this is officially deprecated now https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/refreshview |
I've recently encountered the same issue with the refreshView. I dont use prism but i use MVVM with the community control toolkit.
|
I'm using PullToRefreshLayout with Prism MVVM, I have a bool property in ViewModel to bind for IsRefreshing called IsBusy and when I set IsBusy to false, the refresher still appear on the page.
The text was updated successfully, but these errors were encountered: