Пример #1
0
        // http://stackoverflow.com/questions/4674163/nstablecolumn-size-to-fit-contents

        public static void SizeColumnsByContent(this NSTableView tableView, int minWidth = 10)
        {
            Contract.Requires(tableView != null);
            Contract.Requires(tableView.DataSource != null);
            var columns = tableView.TableColumns();
            var widths  = tableView.DetermineColumnContentFitSizes();

            for (int col = 0; col < tableView.ColumnCount; col++)
            {
                columns[col].Width = widths[col];
                //columns[col].ResizingMask = NSTableColumnResizing.UserResizingMask;
            }
        }