Example #1
0
        public override EvasObject CreateNativeView(int index, EvasObject parent)
        {
            View?emptyView = null;

            if (ItemTemplate is DataTemplateSelector selector)
            {
                emptyView = selector.SelectTemplate(this[index], Element).CreateContent() as View;
            }
            else
            {
                emptyView = ItemTemplate.CreateContent() as View;
            }

            var header = CreateHeaderView();
            var footer = CreateFooterView();
            var layout = new StackLayout();

            if (header != null)
            {
                layout.Children.Add(header);
            }
            layout.Children.Add(emptyView);
            if (footer != null)
            {
                layout.Children.Add(footer);
            }

            layout.Parent = Element;

            return(layout.ToPlatform(_context));
        }