O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Presenting Flat Lists

Presenting a list of nongrouped items is done by setting the LongListSelector’s IsGroupingEnabled property to false, which is the default value. When presenting a flat list, there is little difference between a LongListSelector and a regular ListBox control, apart from the added header and footer of the LongListSelector.

To demonstrate how to display a flat list in a LongListSelector, we populate a LongListSelector with a list of custom City objects.

The FlatListViewModel in the downloadable sample code exposes a list of cities (see Listing 10.1).

LISTING 10.1. FlatListViewModel Class

public class FlatListViewModel : ViewModelBase{    readonly IEnumerable<City> cities = new List<City>        { ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required