Пример #1
0
        void UpdateDefaultSupplementaryView(DefaultCell cell, NSString elementKind, NSIndexPath indexPath)
        {
            cell.Label.Text = ItemsSource.Group(indexPath).ToString();

            if (cell is ItemsViewCell)
            {
                cell.ConstrainTo(GetLayoutSpanCount() * ItemsViewLayout.ConstrainedDimension);
            }
        }
Пример #2
0
        protected virtual void UpdateDefaultCell(DefaultCell cell, NSIndexPath indexPath)
        {
            cell.Label.Text = ItemsSource[indexPath].ToString();

            if (cell is ItemsViewCell constrainedCell)
            {
                ItemsViewLayout.PrepareCellForLayout(constrainedCell);
            }
        }
Пример #3
0
        CGSize MeasureDefaultSupplementaryCell(NSString elementKind, nint section, NSString reuseId)
        {
            if (_measurementCellDefault == null)
            {
                if (reuseId == HorizontalDefaultSupplementalView.ReuseId)
                {
                    _measurementCellDefault = new HorizontalDefaultSupplementalView(CGRect.Empty);
                }
                else if (reuseId == VerticalDefaultSupplementalView.ReuseId)
                {
                    _measurementCellDefault = new VerticalDefaultSupplementalView(CGRect.Empty);
                }
            }

            if (_measurementCellDefault == null)
            {
                return(CGSize.Empty);
            }

            UpdateDefaultSupplementaryView(_measurementCellDefault, elementKind, NSIndexPath.FromItemSection(0, section));
            return(_measurementCellDefault.Measure());
        }