示例#1
0
 public InsertCellAction(DragDropGrid grid, int columnIndex, int rowIndex, UIElement element)
 {
     this.grid        = grid;
     this.columnIndex = columnIndex;
     this.rowIndex    = rowIndex;
     this.element     = element;
 }
示例#2
0
        public static void DeleteEmptyRowsAndColumns(ContentPanel contentPanel)
        {
            DragDropGrid grid = contentPanel.Parent as DragDropGrid;

            if (grid != null)
            {
                Actions.DeleteEmptyRowsAndColumns(grid);
            }
        }
 public InsertColumnGridDropLocation(DragDropGrid panel, int column, int row, bool insertAtTheEnd, Rect insertionLineCoordinates)
 {
     this.panel = panel;
     if (insertAtTheEnd)
     {
         column++;
     }
     this.column = column;
     this.row    = row;
     this.insertionLineCoordinates = insertionLineCoordinates;
 }
示例#4
0
        public static void DeleteContentPanelContents(ContentPanel contentPanel)
        {
            DragDropGrid grid = contentPanel.Parent as DragDropGrid;

            if (grid != null)
            {
                int columnIndex = Grid.GetColumn(contentPanel);
                int rowIndex    = Grid.GetRow(contentPanel);
                Actions.RemoveCell(grid, columnIndex, rowIndex);
                return;
            }
            Actions.RemoveElementFromPanel(contentPanel, contentPanel.Children[0]);
        }
示例#5
0
        public virtual void Select(UIElement element)
        {
            SelectionManager.Select(element);

            DragDropGrid grid = this.Parent as DragDropGrid;

            if (grid == null)
            {
                return;
            }

            var proxy = new GridItemProxy(grid, this);

            Designer.Instance.GridPropertyGrid.Show(proxy, Designer.Instance.ActionManager);
        }
示例#6
0
        public new void Drop(IDragSource dragSource, UIElement draggedElement)
        {
            dragSource.CompleteDrag();
            DragDropGrid grid = this.Parent as DragDropGrid;

            if (grid != null)
            {
                int column = Grid.GetColumn(this);
                int row    = Grid.GetRow(this);
                Actions.AddNewCell(grid, column, row, draggedElement);
            }
            else
            {
                Actions.InsertChild(this, draggedElement);
            }
            dragSource.AfterDropComplete();
        }
示例#7
0
        public static void AddNewCell(DragDropGrid grid, int columnIndex, int rowIndex, UIElement element)
        {
            var action = new InsertCellAction(grid, columnIndex, rowIndex, element);

            Record(action);
        }
示例#8
0
 public InsertColumnAction(DragDropGrid grid, int columnIndex)
 {
     this.grid             = grid;
     this.columnIndex      = columnIndex;
     this.columnDefinition = new ColumnDefinition();
 }
 public DeleteEmptyRowsAndColumnsAction(DragDropGrid grid)
 {
     this.grid = grid;
 }
示例#10
0
 public RemoveRowAction(DragDropGrid grid, int rowIndex)
 {
     this.grid          = grid;
     this.rowIndex      = rowIndex;
     this.rowDefinition = grid.RowDefinitions[rowIndex];
 }
示例#11
0
 public InsertRowAction(DragDropGrid grid, int rowIndex)
 {
     this.grid          = grid;
     this.rowIndex      = rowIndex;
     this.rowDefinition = new RowDefinition();
 }
示例#12
0
        public static void DeleteEmptyRowsAndColumns(DragDropGrid grid)
        {
            var action = new DeleteEmptyRowsAndColumnsAction(grid);

            Record(action);
        }
示例#13
0
 public GridItemProxy(DragDropGrid grid, FrameworkElement item)
 {
     this.grid = grid;
     this.item = item;
 }
示例#14
0
        public static void RemoveCell(DragDropGrid grid, int columnIndex, int rowIndex)
        {
            var action = new RemoveCellAction(grid, columnIndex, rowIndex);

            Record(action);
        }
示例#15
0
 public RemoveCellAction(DragDropGrid grid, int columnIndex, int rowIndex)
 {
     this.grid        = grid;
     this.columnIndex = columnIndex;
     this.rowIndex    = rowIndex;
 }
示例#16
0
        public static void RemoveRow(DragDropGrid grid, int rowIndex)
        {
            var action = new RemoveRowAction(grid, rowIndex);

            Record(action);
        }
示例#17
0
        public static void RemoveColumn(DragDropGrid grid, int columnIndex)
        {
            var action = new RemoveColumnAction(grid, columnIndex);

            Record(action);
        }
示例#18
0
 public RemoveColumnAction(DragDropGrid grid, int columnIndex)
 {
     this.grid             = grid;
     this.columnIndex      = columnIndex;
     this.columnDefinition = grid.ColumnDefinitions[columnIndex];
 }