Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Pull to Refresh not working on Windows Phone 8.1

$
0
0

Hi,
I've implemented PullToRefresh as described here
Its working fine on Android, but not on WindowsPhone8.1
`
public class RefreshTest : ContentPage
{
public RefreshTest()
{
Title = "Refresh Test";
}

    protected override void OnAppearing()
    {
        ObservableCollection<string> listItems = new ObservableCollection<string> { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o" };
        ListView listView = new ListView
        {
            ItemsSource = listItems,
            ItemTemplate = new DataTemplate(() =>
            {
                TextCell textCell = new TextCell();
                textCell.SetBinding(TextCell.TextProperty, ".");
                return textCell;
            }),

            IsPullToRefreshEnabled = true,
        };

        listView.RefreshCommand = new Command(() =>
        {
            listItems.Reverse();
            Debug.WriteLine("refreshing...");
            listView.IsRefreshing = false;
        });

        Content = listView;

        base.OnAppearing();
    }

    protected override void OnDisappearing()
    {
        Content = null;
        base.OnDisappearing();
    }
}`

Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>