private void AddCustomBlock(GridBlockModel block) { if (block != null) { _customModel.Add(block); } }
public void CompleteDesignBlock() { if (_currentBlock != null) { _currentBlock = null; } }
private void DoUndo() { if (_customModel.Count > 0) { GridBlockModel block = _customModel[_customModel.Count - 1]; _customModel.RemoveAt(_customModel.Count - 1); OnCustomBlockRemoved(new BlockCreateEventArgs(block)); } }
public void RemoveCustomBlock(GridBlockModel block) { if (block != null) { if (_customModel.Remove(block)) { OnCustomBlockRemoved(new BlockCreateEventArgs(block)); } } }
public void UpdateDesignBlock(RowColumn curRC) { if (_currentBlock == null) { _currentBlock = new GridBlockModel(false); //fe.Children.Add(_currentBlock); AddCustomBlock(_currentBlock); OnCustomBlockAdded(new BlockCreateEventArgs(_currentBlock)); } int rSpan = Math.Abs(curRC.Row - _starRC.Row) + 1; int cSpan = Math.Abs(curRC.Column - _starRC.Column) + 1; _currentBlock.Row = Math.Min(curRC.Row, _starRC.Row); _currentBlock.Column = Math.Min(curRC.Column, _starRC.Column); _currentBlock.RowSpan = rSpan; _currentBlock.ColumnSpan = cSpan; }
public BlockCreateEventArgs(GridBlockModel block) { _block = block; }