The November 2011 update of the wp7 toolkit includes a longlist selector which is great for grouping together a long list of items. We used it for timezone regions. See screenshots below.
Overall the list worked great and in a fairly short amount of time I was able to populate the list with world timezone regions which were nicely grouped together under click-able headingss that allow the user to easily jump to different sections of the list. (For information on working with timezones in wp7 see my earlier post on using the zoneinfo api in wp7).
Unfortunately I encountered two bugs in the control which I ended up wasting way too much time on. The first problem is that binding the selecteditem did not work. If you are using mvvm you will find this especially annoying. The issue as well a workaround is described in detail here.
The second issue (for which I found no information on the internet) can be repeated as follows:
- Create an app and with a long list selector.
- Set it's visibility to collapsed
- Include a button which when clicked sets the longlistselector's visibility property to 'visible'.
- Run the app. Click the button so that the long list selector is displayed then hold down the back button on your phone and switch to another application.
- Hold down the back button and switch back to your application.
- It will now hang on the resuming screen and eventually terminate without throwing an exception.
This bug was an absolute pain to get to get to the bottom of. I tried to workaround it by just changing the margin of the grid containing the longlistselector so that it was either in view or out of view but this did not help. I also tried removing it from a grid and placing it in a stackpanel as well as just updating the longlistselector's visibilty directly but had no joy with that either. In the end the workaround I used was simple. I left the longlistselector as always being visible and just placed the grid containing my default form in front of it. Instead of toggling the visibility on the longlistselector grid Ijust toggled the visibility of this default form and everything worked fine.
Another obvious workaround would have been to just embed the longlistselector in a different xaml page and navigate back and forth between my main page and the longlistselector page. However as my app was already working other than this bug I chose the first option.
I hope this helps someone as it took me quite a while to get to the bottom of both of these issues.