protected virtual void UpdateTemplatedCell(TemplatedCell cell, NSIndexPath indexPath) { cell.ContentSizeChanged -= CellContentSizeChanged; cell.Bind(ItemsView.ItemTemplate, ItemsSource[indexPath], ItemsView); cell.ContentSizeChanged += CellContentSizeChanged; ItemsViewLayout.PrepareCellForLayout(cell); }
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); } }