BeepMenuBarDesigner provides the design-time experience for BeepMenuBar. It wraps all property mutations in DesignerTransaction with IComponentChangeService notifications for clean undo support and .designer.cs serialization. The smart-tag (BeepMenuBarActionList) exposes 5 properties, item manipulation actions, style presets, and height presets.
BeepMenuBarDesigner
Member
Signature
Description
MenuBar
BeepMenuBar? (get)
Casts Component to BeepMenuBar
GetControlSpecificActionLists()
override
Returns new BeepMenuBarActionList(this)
ExecuteAction(desc, Action)
internal void
Wraps action in DesignerTransaction + IComponentChangeService, commits on success, cancels on exception, then calls RefreshDesignerActionUI()
SetPropertyWithTransaction(name, value, desc)
internal void
Same transaction pattern for per-property writes. Uses TypeDescriptor to read/write. No-op when old==new.
Transaction-Wrapped Mutations
internal void SetPropertyWithTransaction(string name, object? value, string desc)
{
var prop = TypeDescriptor.GetProperties(MenuBar)[name];
var old = prop.GetValue(MenuBar);
if (Equals(old, value)) return;
using (var tx = DesignerHost.CreateTransaction(desc))
{
ChangeService.OnComponentChanging(MenuBar, prop);
prop.SetValue(MenuBar, value);
ChangeService.OnComponentChanged(MenuBar, prop, old, value);
tx.Commit();
}
RefreshDesignerActionUI();
}
BeepMenuBarActionList — Smart-Tag
Properties
Property
Type
Category
Description
ItemCount
int
Items
Number of top-level menu items (read-only)
ControlStyle
BeepControlStyle
Style
Visual style of top-level menu items
Height
int
Layout
Menu bar height in pixels
TextFont
Font?
Appearance
Font for menu item text
ShowImage
bool
Appearance
Toggle per-item image/icon column
Action Methods
Method
Description
LoadSampleMenuItems()
Populates the menu bar with a representative sample menu tree (File > New/Open/Save + separator + Exit, Edit > Undo/Redo/Cut/Copy/Paste, Help > About)