【发布时间】:2012-12-26 15:46:57
【问题描述】:
我有一个 xml 文档,我想在其中提取每 10 个元素。我使用这段代码来提取最后 10 个元素,但我的想法是在它们之前获取接下来的 10 个元素,因为我得到了整个文档,所以我不能对 linq 使用分页:
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")
}).Take(10);
有什么想法吗? 谢谢
【问题讨论】:
标签: windows-phone-7 linq-to-xml