Pull to Refresh not working on Windows Phone 8.1

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();
    }
}`

Answers

Sign In or Register to comment.