public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (gridBoxRenderE == null) { var myGridBox = new GridBoxRenderElement(rootgfx, this.Width, this.Height); myGridBox.SetLocation(this.Left, this.Top); this.SetPrimaryRenderElement(myGridBox); this.gridBoxRenderE = myGridBox; //create layers int nrows = this.gridTable.RowCount; int ncols = this.gridTable.ColumnCount; //---------------------------------------- myGridBox.BuildGrid(ncols, nrows, this.CellSizeStyle); //add grid content for (int c = 0; c < ncols; ++c) { for (int r = 0; r < nrows; ++r) { var gridCell = gridTable.GetCell(r, c); var content = gridCell.ContentElement as UIElement; if (content != null) { myGridBox.SetContent(r, c, content); } } } } return(gridBoxRenderE); }
public void AddUI(UIElement ui, int rowIndex, int colIndex) { if (rowIndex < gridTable.RowCount && colIndex < gridTable.ColumnCount) { gridTable.GetCell(rowIndex, colIndex).ContentElement = ui; if (this.gridBoxRenderE != null) { gridBoxRenderE.SetContent(rowIndex, colIndex, ui.GetPrimaryRenderElement(gridBoxRenderE.Root)); } } }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (gridBoxRenderE == null) { var myGridBox = new GridBoxRenderElement(rootgfx, this.Width, this.Height); myGridBox.SetLocation(this.Left, this.Top); this.SetPrimaryRenderElement(myGridBox); this.gridBoxRenderE = myGridBox; //create layers int nrows = this.gridTable.RowCount; int ncols = this.gridTable.ColumnCount; //---------------------------------------- myGridBox.BuildGrid(ncols, nrows, this.CellSizeStyle); //add grid content for (int c = 0; c < ncols; ++c) { for (int r = 0; r < nrows; ++r) { var gridCell = gridTable.GetCell(r, c); var content = gridCell.ContentElement as UIElement; if (content != null) { myGridBox.SetContent(r, c, content); } } } } return gridBoxRenderE; }