Пример #1
0
        public static RowX CreateFrom(FooterRow footerRow)
        {
            if (footerRow == null)
            {
                throw new ArgumentNullException(nameof(footerRow));
            }

            CellX cellX = CellX.CreateFrom(footerRow.FooterCell);

            cellX.HorizontalMerge = int.MaxValue;

            RowX rowX = new()
            {
                Border = footerRow.ParentDataGrid?.Border.IsVisible == true
                    ? DataGridBorderX.CreateFrom(footerRow.ParentDataGrid.Border)
                    : null,
                Cells = new List <CellX>
                {
                    cellX
                }
            };

            rowX.CalculateLayout();

            return(rowX);
        }
    }
Пример #2
0
        public static RowX CreateFrom(HeaderRow headerRow)
        {
            if (headerRow == null)
            {
                throw new ArgumentNullException(nameof(headerRow));
            }

            RowX headerRowX = new()
            {
                Border = headerRow.ParentDataGrid?.Border?.IsVisible == true
                    ? DataGridBorderX.CreateFrom(headerRow.ParentDataGrid.Border)
                    : null,
                Cells = headerRow
                        .Select(CellX.CreateFrom)
                        .ToList()
            };

            headerRowX.CalculateLayout();

            return(headerRowX);
        }