Overview

Namespace: TheTechIdea.Beep.Winform.Controls.Design.Server.Designers
Assembly: TheTechIdea.Beep.Winform.Controls.Design.Server.dll
Inheritance: Microsoft.DotNet.DesignTools.Designers.ControlDesigner
Implements: IBeepDesignerActionHost

BaseBeepControlDesigner is the abstract base class for all leaf control designers in the Beep library. Every control that is NOT a container (buttons, labels, textboxes, grids, charts, calendars, etc.) has a designer that derives from this class.

It provides three critical services:

  1. IComponentChangeService integration — Every property mutation routes through OnComponentChanging/OnComponentChanged for undo and .designer.cs serialization
  2. Unified smart-tag — Combines CommonBeepControlActionList (style/theme/schema) with control-specific action lists
  3. Convenience methods — SetProperty(), GetProperty<T>(), ApplyTheme(), SetStyle()

Key Features

  • Implements IBeepDesignerActionHost for consumption by action lists
  • Captures IComponentChangeService during Initialize()
  • Exposes BeepControl (casts Component to BaseControl) for derived classes
  • Auto-combines CommonBeepControlActionList with control-specific lists in ActionLists property
  • Provides SetStyle(BeepControlStyle) convenience method for style changes
  • All property setters use TypeDescriptor for proper property descriptor resolution
  • Abstract: derived designers MUST implement GetControlSpecificActionLists()

Properties

MemberTypeVisibilityDescription
ChangeServiceIComponentChangeServiceprotectedCaptured during Initialize(). Used for undo/code-gen.
BeepControlBaseControlprotectedCasts Component to BaseControl for convenient access.
ActionListsDesignerActionListCollectionpublic overrideReturns CommonBeepControlActionList + control-specific lists.

Methods

MethodSignatureDescription
Initializevoid Initialize(IComponent component)Captures IComponentChangeService. Calls base.
SetPropertyvoid SetProperty(string name, object value)Sets property via TypeDescriptor with full change notification.
GetPropertyT GetProperty<T>(string name)Gets property value via TypeDescriptor.
ApplyThemevoid ApplyTheme()Calls BeepControl?.ApplyTheme().
SetStylevoid SetStyle(BeepControlStyle style)Convenience: calls SetProperty("ControlStyle", style).
GetControlSpecificActionListsabstract DesignerActionListCollection ...()Override to provide control-specific smart-tag items.

Inheritance Chain

Microsoft.DotNet.DesignTools.Designers.ControlDesigner
  └── BaseBeepControlDesigner (abstract)
       ├── BeepButtonDesigner
       ├── BeepLabelDesigner
       ├── BeepImageDesigner
       ├── BeepCheckBoxDesigner
       ├── BeepComboBoxDesigner
       ├── BeepGridProDesigner
       ├── BeepChartDesigner
       ├── BeepCalendarDesigner
       ├── BeepDockDesigner
       ├── BeepBreadcrumpDesigner
       ├── BeepMenuBarDesigner
       ├── BeepAccordionMenuDesigner
       ├── BeepMultiChipGroupDesigner
       ├── BeepDatePickerDesigner
       ├── BeepMultiSplitterDesigner
       └── ... (+ widget designers)

Smart-Tag Integration

Every leaf control automatically gets CommonBeepControlActionList in its smart-tag panel. This always includes:

  • ControlStyle — The visual style preset (Material3, Fluent, Cyberpunk, etc.)
  • Theme — The theme name to apply
  • Schema — Color schema selection

Control-specific properties and actions are added by overriding GetControlSpecificActionLists() in the derived designer.

Examples

Setting a Property from an Action List

internal class MyActionList : DesignerActionList
{
    private IBeepDesignerActionHost Host =>
        (IBeepDesignerActionHost)Component.Designer;

    public int RowHeight
    {
        get => Host.GetProperty<int>(nameof(RowHeight));
        set => Host.SetProperty(nameof(RowHeight), value);
    }
}

Implementing a Concrete Leaf Designer

[Designer(typeof(MyControlDesigner))]
public class MyControl : BaseControl { }

public class MyControlDesigner : BaseBeepControlDesigner
{
    protected override DesignerActionListCollection GetControlSpecificActionLists()
    {
        return new DesignerActionListCollection
        {
            new MyControlActionList(Component)
        };
    }
}