何在Xamarin表单中做一个简单的isPulledToRefr

何在Xamarin表单中做一个简单的isPulledToRefr

本文介绍了如何在Xamarin表单中做一个简单的isPulledToRefresh?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在XAML中启用了isPulledToRefresh(true),并且列表视图名称为"EmployeeList".我下面处理的以下代码不起作用.

I have isPulledToRefresh enabled (true) in my XAML and my listviews name is "EmployeeList". This code below that I have worked on does not work.

public static List<createSomething> ourPitems = new List <createSomething>();

public StartPage()
{
    InitializeComponent();
    loadOurList();
}

void loadOurList()
{
    EmployeeList.BeginRefresh();
    EmployeeList.ItemsSource = ourPitems;
    EmployeeList.EndRefresh();
}

装载轮"一直在旋转.(createSomething是我的公开课程,但我想我不必显示该代码).

the "loading wheel" just keeps spinning.(createSomething is my public class but i guess that I do not have to show that code).

推荐答案

您应该创建一个命令并将其关联到ListView,我在Github中有一个示例 https://github.com/Char0394/PullRefresh-XamarinForms-

You should create a command and associate it to the ListView,I have an example in my Github https://github.com/Char0394/PullRefresh-XamarinForms-

这篇关于如何在Xamarin表单中做一个简单的isPulledToRefresh?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 21:27