![](/img/trans.png)
[英]Selecting the next item in LongListSelector windows phone 8
[英]Item count for longlistselector on windows phone 7?
我沒有看到lls.items.count
的lls.items.count。
我如何從沒有組標題的LLS獲取項目計數?
LongListSelector
類使用ItemsSource
來保存選擇器正在顯示的基礎集合。 它被聲明為IEnumerable
因此您應該能夠使用Count()
擴展方法來獲取計數。 首先需要將其Cast<>()
轉換為通用可枚舉(使用Cast<>()
)。
嘗試這個:
var count = lls.ItemsSource.Cast<object>().Count();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.