Exemple #1
0
 /// <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());
     });
 }
Exemple #2
0
        // 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;
        }