WinForms Runtime
WinFormFormHost — drop it on a WinForms form, assign a manager, and it binds every block your Object Navigator defined.
WinFormFormHost
Defined in TheTechIdea.Beep.Forms.WinForms/Forms/FormHost/WinFormFormHost.cs — a partial class split across roughly 18 files by concern (Alerts, Audit, Blocks, Menu, Query, Triggers, and more). This is what a WinForms developer actually touches:
| Member | Type | What it does |
|---|---|---|
Definition | FormDefinition | Design-time block declarations. Generated code does _formsHost.Definition.Blocks.Add(ordDefinition). |
FormsManager | IUnitofWorksManager? | Assigning it triggers the real bind sequence — see below. |
ActiveBlockName | string | The block currently in focus. |
FormFactory | IWinFormFormsFactory | Needed for CALL_FORM to open another form. |
ActiveBlockChanged | event | Fires when focus moves to a different block. |
NotificationRaised | event | Engine-raised notifications surface here. |
MessageRaised / MessageCleared | event | Status-bar-style message lifecycle. |
TimerFired | event | A registered CREATE_TIMER elapsed. |
FormMessageReceived | event | Cross-form messaging (used by CALL_FORM parameter passing). |
What assigning FormsManager actually does
Setting FormsManager to a real IUnitofWorksManager runs the bind sequence:
DefinitionBlockRegistrar.RegisterAll(manager, Definition)turns the design-time blocks into live engine blocks.- Every
IBlockViewdiscovered in the host's control tree is bound to its matching engine block. AutoWireSurfaces()/RefreshStatusSurfaces()sweep the control tree for status/nav-bar controls and wire them up automatically — there is no manual event wiring beyond naming your blocks and dropping controls into the tree.
If any exception happens mid-bind, every partially-bound block is unbound and the previous manager is restored before the exception is rethrown. A failed manager swap never leaves the host half-bound.
Multiple blocks, one host
Sibling WinFormBlockHost controls — one per block, named to match BlockDefinition.BlockName — coexist directly in the form host's control tree and are auto-discovered. There's no per-host limit on how many blocks can be visible simultaneously; a master-detail screen (see the Order Entry example) is just two WinFormBlockHost controls inside one WinFormFormHost.
BeepWpfForms shows only one active block per host — see WPF Runtime for what that means for master-detail on WPF.