【发布时间】:2012-12-31 11:56:23
【问题描述】:
我有一个 xml 文档,我想在其中提取每 10 个元素。我使用此代码提取最后 10 个元素,然后跳过 10 个元素并获取较旧的元素,我使用了此代码,但它通过跳过最后 10 个元素,将较旧的第一个列表替换为包含最旧 10 个的另一个列表,我想要什么是获取最后 10 个元素,当用户按下按钮时,他将获取较旧的列表和另外 10 个较旧的元素:
slideView.ItemsSource =
(from channel in xmlItems.Descendants("album")
orderby (int)channel.Element("catid") descending
select new onair
{
title = (string)channel.Element("name"),
photo = (string)channel.Element("picture")
}).Skip(10).Take(10);
有什么想法吗?
【问题讨论】:
标签: windows-phone-7 linq-to-xml