protected virtual void UpdateDefaultCell(DefaultCell cell, NSIndexPath indexPath) { cell.Label.Text = _itemsSource[indexPath.Row].ToString(); if (cell is ItemsViewCell constrainedCell) { _layout.PrepareCellForLayout(constrainedCell); } }
protected virtual void UpdateTemplatedCell(TemplatedCell cell, NSIndexPath indexPath) { cell.ContentSizeChanged -= CellContentSizeChanged; cell.LayoutAttributesChanged -= CellLayoutAttributesChanged; var bindingContext = ItemsSource[indexPath]; // If we've already created a cell for this index path (for measurement), re-use the content if (_measurementCells.TryGetValue(bindingContext, out TemplatedCell measurementCell)) { _measurementCells.Remove(bindingContext); measurementCell.ContentSizeChanged -= CellContentSizeChanged; measurementCell.LayoutAttributesChanged -= CellLayoutAttributesChanged; cell.UseContent(measurementCell); } else { cell.Bind(ItemsView.ItemTemplate, ItemsSource[indexPath], ItemsView); } cell.ContentSizeChanged += CellContentSizeChanged; cell.LayoutAttributesChanged += CellLayoutAttributesChanged; ItemsViewLayout.PrepareCellForLayout(cell); }
protected virtual void UpdateTemplatedCell(TemplatedCell cell, NSIndexPath indexPath) { ApplyTemplateAndDataContext(cell, indexPath); if (cell is ItemsViewCell constrainedCell) { ItemsViewLayout.PrepareCellForLayout(constrainedCell); } }
protected virtual void UpdateTemplatedCell(TemplatedCell cell, NSIndexPath indexPath) { cell.ContentSizeChanged -= CellContentSizeChanged; cell.Bind(ItemsView, ItemsSource[indexPath]); cell.ContentSizeChanged += CellContentSizeChanged; ItemsViewLayout.PrepareCellForLayout(cell); }