无限长列表选择器

本文关键字:选择器 列表 无限 | 更新日期: 2023-09-27 17:59:20

我想实现对web客户端uri下载的无限滚动。但我找不到一个长列表选择器的工作示例。

目前我的长列表选择器列出的结果数量有限,如果我可以实现php页面来查询,我如何在windowsphone中做到这一点?

无限长列表选择器

看看微软的这个示例。这是一个具有无限滚动功能的twitter示例。

在示例中,他们侦听ItemRealized事件以从视图模型加载更多项。然后,视图模型将项目添加到可观察集合的末尾。

void resultListBox_ItemRealized(object sender, ItemRealizationEventArgs e) 
    { 
        if (!_viewModel.IsLoading && resultListBox.ItemsSource != null &&  

resultListBox.ItemsSource.Count

=_offsetKnob){if(e.ItemKind==LongListSelectorItemKind.Item){if(e.Container.Content为
TwitterSearchResult)。等于(resultListBox。项目源[resultListBox.ItemsSource.Count-_offsetKnob]){Debug.WriteLine("正在搜索{0}",_pageNumber);_viewModel.LoadPage(_searchTerm,_pageNumber++);}}}}