SetContent() public method

public SetContent ( int r, int c, RenderElement re ) : void
r int
c int
re RenderElement
return void
Beispiel #1
0
        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);
        }
Beispiel #2
0
 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));
         }
     }
 }
Beispiel #3
0
        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;
        }