Exemplo n.º 1
0
        StackLayout BuildListView(RootPageViewModel viewModel)
        {
            var headerTemplate = new DataTemplate(typeof(ModuleMediaListHeaderTemplate));

            headerTemplate.CreateContent();

            var itemTemplate = new DataTemplate(typeof(ModuleMediaListItemTemplate));

            itemTemplate.CreateContent();

            _listView = new ListView
            {
                ItemsSource         = viewModel.MediaSections,
                IsGroupingEnabled   = true,
                GroupDisplayBinding = new Binding("SectionName"),
                HasUnevenRows       = false,
                GroupHeaderTemplate = headerTemplate,
                ItemTemplate        = itemTemplate
            };

            return(new StackLayout {
                Children = { _listView }
            });
        }
Exemplo n.º 2
0
        public Issue1590()
        {
            var vm = new RootPageViewModel();

            Content = BuildListView(vm);
        }