Beispiel #1
0
        private Size[,] GetCellSizes()
        {
            var remainingHeight = ActualSize.Height;

            var columns = GetColumns();

            var rowCount    = Rows.Count;
            var columnCount = columns.Count;

            var sizes = new Size[columnCount, rowCount];

            for (var y = 0; y < rowCount; y++)
            {
                var rowHeight = MeasureMath.Min(MeasureRowHeight(Rows[y]), remainingHeight);
                remainingHeight -= rowHeight;

                var remainingWidth = ActualSize.Width;

                for (var x = 0; x < columnCount; x++)
                {
                    var columnWidth = MeasureMath.Min(MeasureColumnWidth(columns[x]), remainingWidth);
                    sizes[x, y]     = new Size(columnWidth, rowHeight);
                    remainingWidth -= columnWidth;
                }
            }

            return(sizes);
        }
Beispiel #2
0
        protected override void DoArrange()
        {
            var cellSizes = GetCellSizes();

            for (var y = 0; y < Rows.Count; y++)
            {
                var cells = Rows[y];

                for (var x = 0; x < cells.Count; x++)
                {
                    var cell = cells[x];

                    cell.Arrange(MeasureMath.Min(cell.MeasuredSize, cellSizes[x, y]));
                }
            }
        }
Beispiel #3
0
 protected override void DoArrange()
 {
     Content?.Arrange(MeasureMath.Min(Content.MeasuredSize, ActualSize));
 }