public override nfloat GetSizeToFitColumnWidth(NSOutlineView outlineView, nint column) { var tableColumn = Backend.Columns[(int)column] as TableColumn; var width = tableColumn.HeaderCell.CellSize.Width; CompositeCell templateCell = null; for (int i = 0; i < outlineView.RowCount; i++) { var cellView = outlineView.GetView(column, i, false) as CompositeCell; if (cellView == null) // use template for invisible rows { cellView = templateCell ?? (templateCell = (tableColumn as TableColumn)?.DataView?.Copy() as CompositeCell); if (cellView != null) { cellView.ObjectValue = outlineView.ItemAtRow(i); } } if (cellView != null) { if (column == 0) // first column contains expanders { width = (nfloat)Math.Max(width, cellView.Frame.X + cellView.FittingSize.Width); } else { width = (nfloat)Math.Max(width, cellView.FittingSize.Width); } } } return(width); }
private NSView GetViewForItem(NSOutlineView outline, NSObjectFacade facade, bool makeIfNeccessary = false) { nint row = outline.RowForItem(facade); return(outline.GetView(0, row, makeIfNeccessary)); }
private NSView GetViewForItem(NSOutlineView outline, NSObjectFacade facade) { nint row = outline.RowForItem(facade); return(outline.GetView(0, row, false)); }