/// <summary> /// set the ListView's ItemTemplate to use the provided SongFactory /// </summary> /// <param name="factory">Factory.</param> private void SetItemTemplateWithFactory(SongCellFactory factory) { this.ItemTemplate = new DataTemplate(() => { return(factory.BuildView()); }); }
// TODO: include drag and drop endpoints for a drag-n-drop controller // TODO: create other constructors or expose setters? public SongListView(SongListModel songs, SongCellFactory factory) { // use the default factory SetItemTemplateWithFactory(factory); // set the model this.Songs = songs; this.ItemsSource = this.Songs; // add tap handler this.ItemTapped += OnItemTapped; }