BaseBeepControlDesigner
The abstract base designer for all leaf (non-container) Beep controls — provides unified smart-tag surface with style/theme/schema and IComponentChangeService-backed property mutation
Table of Contents
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:
- IComponentChangeService integration — Every property mutation routes through OnComponentChanging/OnComponentChanged for undo and .designer.cs serialization
- Unified smart-tag — Combines
CommonBeepControlActionList(style/theme/schema) with control-specific action lists - Convenience methods —
SetProperty(),GetProperty<T>(),ApplyTheme(),SetStyle()
Key Features
- Implements
IBeepDesignerActionHostfor consumption by action lists - Captures
IComponentChangeServiceduringInitialize() - Exposes
BeepControl(casts Component to BaseControl) for derived classes - Auto-combines
CommonBeepControlActionListwith control-specific lists inActionListsproperty - Provides
SetStyle(BeepControlStyle)convenience method for style changes - All property setters use
TypeDescriptorfor proper property descriptor resolution - Abstract: derived designers MUST implement
GetControlSpecificActionLists()
Properties
| Member | Type | Visibility | Description |
|---|---|---|---|
| ChangeService | IComponentChangeService | protected | Captured during Initialize(). Used for undo/code-gen. |
| BeepControl | BaseControl | protected | Casts Component to BaseControl for convenient access. |
| ActionLists | DesignerActionListCollection | public override | Returns CommonBeepControlActionList + control-specific lists. |
Methods
| Method | Signature | Description |
|---|---|---|
| Initialize | void Initialize(IComponent component) | Captures IComponentChangeService. Calls base. |
| SetProperty | void SetProperty(string name, object value) | Sets property via TypeDescriptor with full change notification. |
| GetProperty | T GetProperty<T>(string name) | Gets property value via TypeDescriptor. |
| ApplyTheme | void ApplyTheme() | Calls BeepControl?.ApplyTheme(). |
| SetStyle | void SetStyle(BeepControlStyle style) | Convenience: calls SetProperty("ControlStyle", style). |
| GetControlSpecificActionLists | abstract 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)
};
}
}