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…

  1. 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.
  2. 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 Character class; refer to the module code for this ...

Get Xamarin: Cross-Platform Mobile Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.