Windows phone 8 如何检查用户是否已滚动到ListView中项目的末尾

Windows phone 8 如何检查用户是否已滚动到ListView中项目的末尾,windows-phone-8,windows-phone-8.1,Windows Phone 8,Windows Phone 8.1,有没有办法知道用户是否已滚动到ListView中项目的末尾。我正在Windows Phone 8.1中开发此链接,它将帮助您如果您使用的是winjs,您可以使用该代码 var self = this; document.querySelector(".win-vertical").onscroll = function () { if (self.endOfScroll(this) === true) { //do your stuff } }; endOfSc

有没有办法知道用户是否已滚动到ListView中项目的末尾。我正在Windows Phone 8.1中开发此链接,它将帮助您

如果您使用的是winjs,您可以使用该代码

var self = this;
document.querySelector(".win-vertical").onscroll = function () {
    if (self.endOfScroll(this) === true) {
        //do your stuff
    }
};

endOfScroll: function (element) {
    return element.scrollHeight - element.scrollTop === element.clientHeight
},
我使用win vertical作为“非轴”页面

如果使用透视,可以通过“.win pivot item content”更改透视

在c中#

公共静态ScrollViewer GetScrollViewer(DependencyObject depObj) { 如果(depObj是ScrollViewer),则返回depObj作为ScrollViewer; for(int i=0;i链接从来都不是一个好答案。虽然你的答案很可能是正确的,但如果你能改进你的答案会更好。记住,将来链接可能会断开。你是用c#还是winjs编码的?
public static ScrollViewer GetScrollViewer(DependencyObject depObj)
{
    if (depObj is ScrollViewer) return depObj as ScrollViewer;

    for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++)
    {
        var child = VisualTreeHelper.GetChild(depObj, i);

        var result = GetScrollViewer(child);
        if (result != null) return result;
    }
    return null;
}

// subscription:
GetScrollViewer(yourListView).ViewChanged += yourEvent_ViewChanged;