WP7 ListBox Grouping

对着背影说爱祢 提交于 2019-12-20 14:43:10

问题


Is there any in-built grouping for ListBoxes or another UI control? I would like to have a list but have some form of grouping or sections applied to the list. As shown below:

heading one
     list item one
     list item two
heading two
     list item one
     list item two
     list item three
     list item four

Is there anything available for such purpose without building something from scratch? I don't wish to mix a match multiple ListBoxes, rather I would prefer a solution where this was handled at the data binding level.


回答1:


You want to look at the "Long List Selector" in the Silverlight for Windows Phone Toolkit

Its a control that looks+behaves just like the grouping behavior in contacts/etc on the phone.




回答2:


LongListSelector comes to mind.

Using LongListSelector without LINQ - Andy Pennell's Blog

WP7 LongListSelector in depth | Part1: Visual structure and API | WindowsPhoneGeek

WP7 LongListSelector in depth | Part2: Data binding scenarios | WindowsPhoneGeek

Alternatively, you could look into applying either of these grouping implementations to the phone's listbox.

Confessions of a ListBox groupie [Using IValueConverter to create a grouped list of items simply and flexibly] - Delay's Blog

How to group items in a list by their first letter in Silverlight? - Stack Overflow




回答3:


Have you considered putting the different lists in different items in a pivot?



来源:https://stackoverflow.com/questions/4226039/wp7-listbox-grouping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!