예제 #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];
 }