Beispiel #1
0
        protected virtual void UpdateTemplatedCell(TemplatedCell cell, NSIndexPath indexPath)
        {
            cell.ContentSizeChanged -= CellContentSizeChanged;

            cell.Bind(ItemsView.ItemTemplate, ItemsSource[indexPath], ItemsView);

            cell.ContentSizeChanged += CellContentSizeChanged;

            ItemsViewLayout.PrepareCellForLayout(cell);
        }
Beispiel #2
0
        void UpdateTemplatedSupplementaryView(TemplatedCell cell, NSString elementKind, NSIndexPath indexPath)
        {
            DataTemplate template = elementKind == UICollectionElementKindSectionKey.Header
                                ? ItemsView.GroupHeaderTemplate
                                : ItemsView.GroupFooterTemplate;

            var bindingContext = ItemsSource.Group(indexPath);

            cell.Bind(template, bindingContext, ItemsView);

            if (cell is ItemsViewCell)
            {
                cell.ConstrainTo(GetLayoutSpanCount() * ItemsViewLayout.ConstrainedDimension);
            }
        }