Xamarin.forms: PullTORefresh is not working for the UWP platform using XamarinForms ListVIew

Created on 13 Mar 2018  Â·  14Comments  Â·  Source: xamarin/Xamarin.Forms

Description

Added a listview in my application and added the enable the PullToRefresh property for the listView.

Steps to Reproduce

  1. Creating XamarinForms application and add a ListView conrol to forms
  2. Enable PullToRefresh property and add a Refresh command
  3. The Refresh command is not getting called

Expected Behavior

This should call the Refresh command

Actual Behavior

This is not happening on UWP. I have only tested on the Windows 10 tablets.

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:

    • iOS:

    • Android:

    • UWP:

  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

UWP proposal-open enhancement âž•

Most helpful comment

UWP supports this now - as of Windows 10 build 1803: https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/pull-to-refresh

Looks pretty trivial to wire up too. Would be good to get this added to XamForms.

All 14 comments

I don't get this part of your comment

This is not happening on UWP. I have only tested on the Windows 10 tablets.

could you please:

  • attach a small project triggering the issue
  • tell us on which platform it happens

Thanks

Hi Stephane,
I have created the sample for the PullToRefresh XamarinForms feature. The file-size was large so uploaded to google drive and find the below link.

https://drive.google.com/open?id=1YzhrE9xH8GBJslEbzUEhtTyncsZAE1uP

As per XamarinForms docs, I have added the below code to enable the PullToRefresh feature:-

IsPullToRefreshEnabled="true" RefreshCommand="{Binding RefreshCommand}" IsRefreshing="{Binding IsBusy}"
Next, RefreshCOmmand is added in the ViewModel

Issue:- Trying to pulling down the list view but Refresh command is not getting called.

Please suggest or correct me if anything more need to be added to get this working.

Looking ahead for your quick reply.
Let me know if you are facing any issue while dowloading the sample from the google drive.

Hi Stephane,

Please find sample code link which is having a PullToRefresh feature property enabled but refresh command is not getting called.

https://drive.google.com/open?id=1YzhrE9xH8GBJslEbzUEhtTyncsZAE1uP

Let me know if you need any more details.

Thanks & Regards,

Alok Pandey

From: Stephane Delcroix [mailto:[email protected]]
Sent: Tuesday, March 13, 2018 5:57 PM
To: xamarin/Xamarin.Forms Xamarin.Forms@noreply.github.com
Cc: Pandey, Alok Kumar Alok.K.Pandey@in.unisys.com; Author author@noreply.github.com
Subject: Re: [xamarin/Xamarin.Forms] PullTORefresh is not working for the UWP platform using XamarinForms ListVIew (#2086)

I don't get this part of your comment

This is not happening on UWP. I have only tested on the Windows 10 tablets.

could you please:

  • attach a small project triggering the issue
  • tell us on which platform it happens

Thanks

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/xamarin/Xamarin.Forms/issues/2086#issuecomment-372647948 , or mute the thread https://github.com/notifications/unsubscribe-auth/Abw5g3XklwpuaXo3j4z37vqFduA6RzFSks5td7r2gaJpZM4SoD1- . https://github.com/notifications/beacon/Abw5gwUV4KXdLovNgMOrTc96Q2EldAOxks5td7r2gaJpZM4SoD1-.gif

@PandeyAlokKumar you still haven't been clear about the platform on which this happens

I am currently checking on UWP platform.

From: Stephane Delcroix [mailto:[email protected]]
Sent: Wednesday, March 14, 2018 2:20 PM
To: xamarin/Xamarin.Forms Xamarin.Forms@noreply.github.com
Cc: Pandey, Alok Kumar Alok.K.Pandey@in.unisys.com; Mention mention@noreply.github.com
Subject: Re: [xamarin/Xamarin.Forms] PullTORefresh is not working for the UWP platform using XamarinForms ListVIew (#2086)

@PandeyAlokKumar https://github.com/pandeyalokkumar you still haven't been clear about the platform on which this happens

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/xamarin/Xamarin.Forms/issues/2086#issuecomment-372946404 , or mute the thread https://github.com/notifications/unsubscribe-auth/Abw5g-mg_0N1XD5w_KpSt8VEFM6PF7Tuks5teNmcgaJpZM4SoD1- . https://github.com/notifications/beacon/Abw5g8tRqLs1rCWha-fgUTUhBvFqGmwGks5teNmcgaJpZM4SoD1-.gif

Pull to refresh is not implemented in UWP at the moment. this explain why it doesn't work...

Any alternate approach to achieve this on UWP platform?

I guess you should just add a button above or below the ListView. Alternatively you could add a ToolbarItem and let that call your "RefreshCommand". I'm currently debating this issue myself.

Just as a side node, beside adding a refresh button, I have actually also created a custom renderer for the ContentPage to intercept KeyEvents, so hitting F5 will also refresh the data in my listview. Works like a charm.

UWP supports this now - as of Windows 10 build 1803: https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/pull-to-refresh

Looks pretty trivial to wire up too. Would be good to get this added to XamForms.

Any update on this? or @nbevans did you find a workaround?

Edit: For those interested, Xamarin Forms 4.3 introduces RefreshView that can be used on ListViews

@StephaneDelcroix Any updates for using PullToRefresh in UWP desktop mode? It doesn't do anything on desktop mode.

Please try the RefreshView instead. Thanks!

Is ListView deperecated now?

Was this page helpful?
0 / 5 - 0 ratings