Exemplo n.º 1
0
        protected override void ConfigureUI()
        {
            var template = new DataTemplate(typeof(ImageListCell));

            template.BindTo <ImageListJsonObject, string>(ImageCell.ImageSourceProperty, m => m.Image);
            template.BindTo <ImageListJsonObject, string>(TextCell.TextProperty, m => m.Title);
            template.BindTo <ImageListJsonObject, string>(TextCell.DetailProperty, m => m.Description);

            Content = new StackLayout {
                Orientation = StackOrientation.Vertical,
                Padding     = 0,
                Spacing     = 0,
                Children    =
                {
                    (List                 = new ImageList {
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        VerticalOptions   = LayoutOptions.FillAndExpand,
                        ItemTemplate      = template
                    }).BindTo(ItemsView <Cell> .ItemsSourceProperty, _(m => m.Collection))
                }
            };
        }