public TextCellVM CreateTextBox() { var textCell = new TextCellVM() { Content = "123", Height = 50, Width = 80, CellRow = 0, CellColumn = 0, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, NameColor = System.Windows.Media.Colors.White.ToString() }; Cells.Add(textCell); selectCell = textCell; return(textCell); }
public void CreateTextOnRow() { if (Columns == 1) { while (oldRows < Rows) { var textCell = new TextCellVM() { Content = "123", Height = Cells[0].Height, Width = Cells[0].Width, CellRow = oldRows, CellColumn = Columns - 1, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, NameColor = System.Windows.Media.Colors.White.ToString() }; Height += Cells[0].Height; Cells.Add(textCell); selectCell = textCell; oldRows++; } return; } for (; oldRows < Rows; oldRows++) { Height += Cells[0].Height; for (var i = 0; i <= Columns - 1; i++) { var textCell = new TextCellVM() { Content = "123", Height = Cells[0].Height, Width = Cells[0].Width, CellRow = oldRows, CellColumn = i, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, NameColor = System.Windows.Media.Colors.White.ToString() }; Cells.Add(textCell); selectCell = textCell; } } }
public void CreateTextOnColumn() { if (Rows == 1) { while (oldColumns < Columns) { var textCell = new TextCellVM() { Content = "123", Height = Cells[0].Height, Width = Cells[0].Width, CellRow = Rows - 1, CellColumn = oldColumns, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, NameColor = System.Windows.Media.Colors.White.ToString() }; Width += Cells[0].Width; Cells.Add(textCell); selectCell = textCell; oldColumns++; } } for (; oldColumns < Columns; oldColumns++) { Width += Cells[0].Width; for (var i = 0; i <= Rows - 1; i++) { var textCell = new TextCellVM() { Content = "123", Height = Cells[0].Height, Width = Cells[0].Width, CellRow = i, CellColumn = oldColumns, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, NameColor = System.Windows.Media.Colors.White.ToString() }; Cells.Add(textCell); selectCell = textCell; } } }