Exemplo n.º 1
0
 public InsertCellAction(DragDropGrid grid, int columnIndex, int rowIndex, UIElement element)
 {
     this.grid        = grid;
     this.columnIndex = columnIndex;
     this.rowIndex    = rowIndex;
     this.element     = element;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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]);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 7
0
        public static void AddNewCell(DragDropGrid grid, int columnIndex, int rowIndex, UIElement element)
        {
            var action = new InsertCellAction(grid, columnIndex, rowIndex, element);

            Record(action);
        }
Exemplo n.º 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;
 }
Exemplo n.º 10
0
 public RemoveRowAction(DragDropGrid grid, int rowIndex)
 {
     this.grid          = grid;
     this.rowIndex      = rowIndex;
     this.rowDefinition = grid.RowDefinitions[rowIndex];
 }
Exemplo n.º 11
0
 public InsertRowAction(DragDropGrid grid, int rowIndex)
 {
     this.grid          = grid;
     this.rowIndex      = rowIndex;
     this.rowDefinition = new RowDefinition();
 }
Exemplo n.º 12
0
        public static void DeleteEmptyRowsAndColumns(DragDropGrid grid)
        {
            var action = new DeleteEmptyRowsAndColumnsAction(grid);

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

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

            Record(action);
        }
Exemplo n.º 17
0
        public static void RemoveColumn(DragDropGrid grid, int columnIndex)
        {
            var action = new RemoveColumnAction(grid, columnIndex);

            Record(action);
        }
Exemplo n.º 18
0
 public RemoveColumnAction(DragDropGrid grid, int columnIndex)
 {
     this.grid             = grid;
     this.columnIndex      = columnIndex;
     this.columnDefinition = grid.ColumnDefinitions[columnIndex];
 }