我想通过分页从ListView中的Web API获取数据。到目前为止,我在代码中看不到任何问题,但是在Handle_OnDemandLoading中获取空值
private FeaturedItemList products = new FeaturedItemList();
protected async void FeaturedList()
{
var httpClient = new HttpClient();
var json = await httpClient.GetStringAsync("http://orangepotato.rjcpacking.com/index.php?route=api/login/getFeaturedProducts");
products = JsonConvert.DeserializeObject<FeaturedItemList>(json);
dataPager.Source = products.products;
}
void Handle_OnDemandLoading(object sender, Syncfusion.SfDataGrid.XForms.DataPager.OnDemandLoadingEventArgs e)
{
var source= products.products.Skip(e.StartIndex).Take(e.PageSize);
FeaturedlistView.ItemsSource = source.AsEnumerable();// here is i am getting null values but i am getting values in datapager.source
}