Issues with SfPullToRefresh in conjunction with SfListView

I am trying to convert a standard Xamarin Forms CollectionView inside a RefreshView on one page in my app. This has been unexpectedly hard, and I don’t have a fully working page yet. I’m using MVVM and the Command pattern and the content page is instantiated via the Xamarin Shell, i.e. it has a header on top (not sure if this is significant).

The issues are in order of significance:

  •  I have not been able to get it to work at all with iOS. On Android, it works, but on iOS, the refresh spinner is not displayed, and the refresh command does not execute.
  • Setting IsRefreshing in code does not show the spinner, which is unfortunate as it can be used to indicate to the user that the content is loading the first time the page is shown. This is the behavior in the Xamarin Forms RefreshView that I’m migrating from.
  • There are many values that you have to tweak to get it working sort of like the standard RefreshView. Out of the box, it is far too big and requires the user to drag it a long way before the refresh is triggered. It has taken me hours of fiddling and it still does not look like the standard refresh view. So, with the standard RefreshView, this is the XAML: 
     RefreshView
     IsRefreshing="{Binding IsRefreshing}"
     Command="{Binding LoadItemsCommand}"
     RefreshColor = “ForestGreen” >
      

          While with the SfPullToRefresh, it is as verbose as this:
          pullToRefresh:SfPullToRefresh
            ProgressStrokeColor="ForestGreen"
            ProgressBackgroundColor="White"
            PullingThreshold="75"
            RefreshContentThreshold="0"
            RefreshContentHeight="40"
            RefreshContentWidth="40"
           TransitionMode="SlideOnTop"
           IsRefreshing="{Binding IsRefreshing}"
           RefreshCommand="{Binding LoadItemsCommand1}" >
              ...

  • It seems that you HAVE to set IsRefreshing = true and then IsRefreshing = false for it to work at all. Again, that is not how the standard RefreshView is working, where IsRefreshing is true once the user has initiated the refresh and you then turn it off when you are done. See also item 2) above.
  •  I usually declare my Commands with a private setter, but if I do that, the app crashes with MethodAccessException complaining that the setter is inaccessible.  

While I appreciate that we typically have more flexibility with your excellent controls and thus more properties and options to set, I really would have liked the SfListView to have worked with the standard RefreshView, or if that is impossible, then have the SfPullToRefresh to work more like it out of the box. 

P.S.
You should consider a better text editor here, maybe just switch to MD format like we are used to on github. That is far better for formatting code samples.


5 Replies 1 reply marked as answer

KK Karthikraja Kalaimani Syncfusion Team September 28, 2020 01:57 PM UTC

Hi David,

Currently, we are validating your requirement. We will validate and the details on or before 30th September 2020. We appreciate your patience until then.

Regards,
Karthik Raja 



DS David Stewart October 1, 2020 07:56 AM UTC

Hi Karthik,

Any news on this?

Best regards
David Stewart


KK Karthikraja Kalaimani Syncfusion Team October 1, 2020 01:54 PM UTC

Hi David,

Sorry for the miscommunication,

We have checked the SfPullToRefresh with SfListView in Xamarin Forms Shell page but unfortunately, we could not able to reproduce the issue in forms iOS platform. We have attached the tested sample for your reference. So, could you please tell me the Xamarin forms and SfPullToRefresh version to check further ?.  

Sample link :  https://www.syncfusion.com/downloads/support/directtrac/general/ze/Xamarin_Forms___Xaminals_2883301321.zip


Regarding the Standard Refreshview IsRefreshing property, If we implement the Standard Refreshview in SfPullToRefreshView it would be break for all the existing customer.

Regards,
Karthik Raja    


Marked as answer

DS David Stewart October 1, 2020 04:16 PM UTC

Hi again,

I have found the cause of my app not working on iOS and it was in fact very simple: I forgot to initialize the SfPullToRefreshRenderer in the AppDelegate.
Your sample helped me realize that, so thank you.
That also fixed the issue with the RefreshCommand property that couldn't have a private setter.

With regards to setting the IsRefreshing = true not impacting the visibility of the refresh spinner, I fail to see why implementing that behavior would break existing code? It would still be a nice addition. How are your existing customers showing that their apps are busy loading?

Best regards
David


KK Karthikraja Kalaimani Syncfusion Team October 2, 2020 03:57 AM UTC

Hi David,

Thanks for the update. We glad to know that the reported issue has been resolved at you end. Our customers loading the PullToRefreshView by setting IsRefreshing as true and false while pulling action performed.

Regards,
Karthik Raja  


Loader.
Up arrow icon