Beispiel #1
0
        private void MeasureCells(IEnumerable <Cell> cells, UpdateMinLengths updateMinLengths)
        {
            foreach (Cell cell in cells)
            {
                bool shouldChildBeMeasuredWithInfiniteHeight = updateMinLengths == UpdateMinLengths.SkipHeights;

                this.MeasureCell(cell, cell.Child, shouldChildBeMeasuredWithInfiniteHeight);

                if (updateMinLengths != UpdateMinLengths.SkipWidths)
                {
                    DefinitionBase widthDefinition = this.columns[cell.ColumnIndex];
                    widthDefinition.UpdateMinLength(
                        Math.Min(cell.Child.DesiredSize.Width, widthDefinition.UserMaxLength));
                }

                if (updateMinLengths != UpdateMinLengths.SkipHeights)
                {
                    DefinitionBase heightDefinition = this.rows[cell.RowIndex];
                    heightDefinition.UpdateMinLength(
                        Math.Min(cell.Child.DesiredSize.Height, heightDefinition.UserMaxLength));
                }
            }
        }
Beispiel #2
0
        private void MeasureCells(IEnumerable<Cell> cells, UpdateMinLengths updateMinLengths)
        {
            foreach (Cell cell in cells)
            {
                bool shouldChildBeMeasuredWithInfiniteHeight = updateMinLengths == UpdateMinLengths.SkipHeights;

                this.MeasureCell(cell, cell.Child, shouldChildBeMeasuredWithInfiniteHeight);

                if (updateMinLengths != UpdateMinLengths.SkipWidths)
                {
                    DefinitionBase widthDefinition = this.columns[cell.ColumnIndex];
                    widthDefinition.UpdateMinLength(
                        Math.Min(cell.Child.DesiredSize.Width, widthDefinition.UserMaxLength));
                }

                if (updateMinLengths != UpdateMinLengths.SkipHeights)
                {
                    DefinitionBase heightDefinition = this.rows[cell.RowIndex];
                    heightDefinition.UpdateMinLength(
                        Math.Min(cell.Child.DesiredSize.Height, heightDefinition.UserMaxLength));
                }
            }
        }