2012-12-26 76 views
1

我有一個xml文檔,我想在其中提取每10個元素。我用這個代碼提取近10元,但這個想法只是他們之前獲得下一個10分的,因爲我得到了整個文檔,我不能使用分頁使用LINQ:從xml文檔提取元素

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); 

任何想法,請? 謝謝

回答

0

嘗試.Skip(10).Take(10)走向您的查詢結束。

+0

你好,確定它做的工作,但它會改變另一個與其他10個元素的舊名單,除了我想動態地這意味着每次按下按鈕時,舊的列表仍然是我們得到下一個10一個和那麼一個。謝謝:) –

+0

有什麼反饋嗎? ! –