【问题标题】:How to add footer to the list box in windows phone 8如何在windows phone 8的列表框中添加页脚
【发布时间】:2013-09-06 06:36:18
【问题描述】:

我正在做一个 windows phone 8 应用程序。在此我使用了列表框。对于第一页,我从服务器获取数据并将该数据添加到列表框中。现在我想在列表框底部(即最后一项之后)添加 Show More,以从服务器获取下一项。

我怎样才能做到这一点?

【问题讨论】:

    标签: windows-phone-8 listbox footer


    【解决方案1】:
    【解决方案2】:
     we can Gets or sets the amount of data to fetch for virtualizing/prefetch operations by using 
     ListViewBase.DataFetchSize property and can Initiates the asynchronous request to load more data items, in accordance with the active incremental loading settings by ListViewBase.LoadMoreItemsAsync method.
    
    If you want to do it by pagination then the following links may be helpfull for you
     DataFetchSize method 
    

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.datafetchsize.aspx

    LoadMoreItemsAsync method: 
    

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.loadmoreitemsasync.aspx

    You can see examples of using these here (though note that the sample was based on Windows 8 BUILD release and the apis have had some changes)
    

    http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e71b7036-4fb7-4963-a65d-5bcb9fd8f664

    【讨论】:

      【解决方案3】:

      我将继续发布逻辑,因为我的代码可能与您的不匹配

      所以

      1 -> 将服务器数据保存在数组或列表中。 2 - >设计xaml的方式是父网格有两行或多行,最后一行显示更多。和之前的列表。 (相应调整高度) 3 -> 用有限数量的数据填充它。 4 -> 接下来使用ListBox.Items.Add(data) 方法将数据添加到列表中。保持 sorted 属性关闭,以便将元素插入到列表的底部 -> 通过链接Add Method for Observable Collections

      使用显示更多按钮单击的第四步.. 并调整列表的高度或将其放入滚动查看器中,以便可以完成有限的高度滚动。如果有进一步的查询,则更新更新

      【讨论】:

        猜你喜欢
        • 2012-11-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-29
        • 2023-03-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多