Hosting in WPF step by step
Put a form together with BeepWpfForms.
In this documentation
- Beep.Forms
- Architecture
- Authoring in the Object Navigator
- WinForms runtime
- WPF runtime
- End-to-end example
- Remote UI limitations
- Overview
- Context menus
- Blocks and items
- Triggers
- Lists of values
- Validation
- Master detail
- Navigation and queries
- Alerts, editors and timers
- Calling other forms
- Form menus
- Hosting in WinForms step by step
- Hosting in WPF step by step
- Saving and loading forms
- The IDE toolbar and dialogs
- Troubleshooting
- Create the providers:
new BeepWpfAlertProvider(() => Application.Current.MainWindow)andnew BeepWpfEditorProvider(...). - Create the manager:
new FormsManager(editor, alertProvider: alertProvider, editorProvider: editorProvider). - Set up each block:
await formsManager.SetupBlockAsync("EMP", "OracleConnection", "EMPLOYEES"). - Create the host:
new BeepWpfForms { FormsManager = formsManager }. - Create a block:
new BeepWpfBlock { BlockName = "EMP", AutoGenerateFields = true }, and aBeepWpfBlockNavigationBar { BlockName = "EMP" }. Setblock.NavigationBarbefore registering the block. - Call
host.RegisterBlock(employees). The WPF host does not discover blocks or navigation bars by itself. - Place the bar in the layout with
(UIElement)bar.View!. - When several hosts share one manager, assign
FormsManagerto each of them. - Assign
FormFactoryfor form calls, and callRegisterBeepFormsMetadata().
The host shows one active block at a time. It finds a WpfFormStatusBar on its own, when it loads and again when the manager is assigned. The status bar offers Bind, Unbind, SyncFromManager, SetSegment, RemoveSegment, ClearSegments, GetSegmentText, SetMessage and ClearMessage.
The contract types keep their older WinForms style namespaces. WPF types live under TheTechIdea.Beep.Wpf.Data.Integrated.Forms.