Displaying a collection and selecting a row
The main requirement for
ListView to work is to provide a collection of data where each item will be translated to a row.
ListView exposes an event that will notify you when a row is tapped; usually, you'll want to register an event handler to navigate to another page.
How to do it…
- In Visual Studio, go to the top menu and select File | New | Project, choose the Blank App (Xamarin.Forms Portable) template, name it
XamFormsDisplayCollections, and click OK.
- The first thing we need is to create our model class and some dummy data to load in
ListView. Right-click the PCL, Add | Class…, name it
Character, and click Add. Find next the abbreviated version of the
Characterclass; refer to the module code for this ...