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.
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 itCharacter
, and click Add. Find next the abbreviated version of theCharacter
class; refer to the book code for this section for the list of characters returned in theCharacters
property:public class Character { public string Name { get; set; } public string Species { get; set; } public string ImageUrl { get; set; } public override string ToString() ...