Overview

Namespace: TheTechIdea.Beep.Winform.Controls.Design.Server.Docking.Infrastructure
Visibility: internal static

BeepDockingDesignerWiring is the central nervous system of the docking design-time infrastructure. It is a static helper class that provides all panel and dockspace operations with proper IComponentChangeService integration.

Every designer in the docking system (BeepDockingManagerDesigner, DockPanelDesigner, BeepDockspaceDesigner) delegates its panel mutations to this class.

Key Features

  • Centralized panel CRUD with IComponentChangeService integration
  • Uses IDesignerHost.CreateComponent() for new panel creation (required for serialization)
  • Panel move, stack, reorder, and resize operations
  • Dockspace resize and position updates
  • Tab drag-drop routing (DropPanelAt)
  • Host form layout refresh after mutations
  • Handles panel activation tracking at design time

Methods

MethodDescription
AddPanel(BeepDockingManager, DockPosition)Creates a new DockPanel component at the given position
RemovePanel(BeepDockingManager, DockPanel)Permanently removes a panel from the manager
MovePanel(BeepDockingManager, DockPanel, DockPosition)Moves a panel to a different dock position
StackPanel(BeepDockingManager, DockPanel, DockPanel)Stacks a panel into the same group as target
ResizePanel(BeepDockingManager, DockPanel, int, int)Updates panel preferred size
ResizeDockspace(BeepDockingManager, BeepDockspace, int, int)Updates dockspace size
DropPanelAt(BeepDockingManager, DockPanel, BeepDockspace, int)Places a panel at a specific index in a dockspace (tab drag-drop)
ActivateDesignPanel(BeepDockingManager, DockPanel)Marks a panel as active at design time
RefreshHostLayout(BeepDockingManager)Forces the host form to reapply the docking layout

Architecture

BeepDockingManagerDesigner ──┐
DockPanelDesigner ─────────┤
BeepDockspaceDesigner ─────┤
                             │
              ┌──────────────▼──────────────┐
              │ BeepDockingDesignerWiring     │
              │ (static helper)               │
              │                                │
              │ IDesignerHost.CreateComponent  │
              │ IComponentChangeService        │
              │ TypeDescriptor.GetProperties   │
              │ Panel.Key validation            │
              │ Layout recalculation             │
              └────────────────────────────────┘

Examples

// Example: How DockPanelDesigner delegates to Wiring
private void ApplyDockPosition(DockPosition position)
{
    var panel = (DockPanel)Component;
    var manager = panel.Manager;
    BeepDockingDesignerWiring.MovePanel(manager, panel, position);
}

// Wiring handles:
// 1. IComponentChangeService.OnComponentChanging(panel)
// 2. panel.DockPosition = newPosition
// 3. manager.RecalculateLayout()
// 4. IComponentChangeService.OnComponentChanged(panel)
// 5. RefreshHostLayout()