Beispiel #1
0
        nfloat CalcRowHeight(nint row, bool tryReuse = true)
        {
            updatingRowHeight = true;
            var height = Table.RowHeight;

            for (int i = 0; i < Columns.Count; i++)
            {
                CompositeCell cell = tryReuse ? Table.GetView(i, row, false) as CompositeCell : null;
                if (cell == null)
                {
                    cell             = (Columns [i] as TableColumn)?.DataView as CompositeCell;
                    cell.ObjectValue = NSNumber.FromNInt(row);
                    height           = (nfloat)Math.Max(height, cell.FittingSize.Height);
                }
                else
                {
                    height = (nfloat)Math.Max(height, cell.GetRequiredHeightForWidth(cell.Frame.Width));
                }
            }
            updatingRowHeight = false;
            return(height);
        }
Beispiel #2
0
        nfloat CalcRowHeight(TreeItem pos, bool tryReuse = true)
        {
            updatingRowHeight = true;
            var height = Table.RowHeight;
            var row    = Tree.RowForItem(pos);

            for (int i = 0; i < Columns.Count; i++)
            {
                CompositeCell cell = tryReuse && row >= 0 ? Tree.GetView(i, row, false) as CompositeCell : null;
                if (cell == null)
                {
                    cell             = (Columns [i] as TableColumn)?.DataView as CompositeCell;
                    cell.ObjectValue = pos;
                    height           = (nfloat)Math.Max(height, cell.FittingSize.Height);
                }
                else
                {
                    height = (nfloat)Math.Max(height, cell.GetRequiredHeightForWidth(cell.Frame.Width));
                }
            }
            updatingRowHeight = false;
            return(height);
        }