本文整理汇总了C#中GridCell.Measure方法的典型用法代码示例。如果您正苦于以下问题:C# GridCell.Measure方法的具体用法?C# GridCell.Measure怎么用?C# GridCell.Measure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridCell
的用法示例。
在下文中一共展示了GridCell.Measure方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MeasureCell
private void MeasureCell(GridLayoutInfo layoutInfo, GridLayoutStateInfo stateInfo,
ColumnAutoSizeMode autoSizeMode, GridRow row, GridCell cell)
{
if (cell.NeedsMeasured || NeedsMeasured || row.NeedsMeasured)
{
int rowHeight = row.GetRowHeight();
if (rowHeight > 0)
{
Size size = new Size(Width, rowHeight);
if (autoSizeMode != ColumnAutoSizeMode.None)
{
cell.Measure(layoutInfo, stateInfo, Size.Empty);
size.Width = cell.Size.Width;
size.Width += GetColumnIndent(stateInfo.IndentLevel);
}
else
{
cell.Measure(layoutInfo, stateInfo, size);
}
cell.Size = size;
}
else
{
Size size = Size.Empty;
if (autoSizeMode == ColumnAutoSizeMode.None)
{
size.Width = Width;
size.Width -= GetColumnIndent(stateInfo.IndentLevel);
size.Width = Math.Max(1, size.Width);
}
cell.Measure(layoutInfo, stateInfo, new Size(size.Width, 0));
if (autoSizeMode != ColumnAutoSizeMode.None)
{
size = cell.Size;
size.Width += GetColumnIndent(stateInfo.IndentLevel);
cell.Size = size;
}
else
{
size = cell.Size;
size.Width = Width;
cell.Size = size;
}
}
cell.CellSize = cell.Size;
}
}