Step-by-Step: Installing and Configuring the CAB DevExpress Extension Kit
Overview
This guide walks you through installing and configuring the CAB DevExpress Extension Kit for a typical WinForms/CAB project so you can integrate DevExpress UI components with the Composite UI Application Block (CAB) quickly and reliably.
Prerequisites
- Visual Studio installed (2017 or later assumed).
- .NET Framework version required by your DevExpress and CAB releases (commonly 4.6.1+).
- DevExpress WinForms controls licensed and installed.
- CAB (Composite UI Application Block) assemblies available — either via NuGet or your internal library.
- Administrative permissions to install extensions and modify project references.
1. Prepare your environment
- Close Visual Studio.
- Ensure DevExpress components are installed and registered (run the DevExpress installer if needed).
- Confirm CAB assemblies or NuGet package versions you’ll use (note exact versions to avoid binding issues).
2. Create or open your CAB WinForms solution
- Open Visual Studio and create a new Windows Forms solution or open your existing CAB solution.
- If starting new: create a class library for modules and a WinForms startup project that hosts the CAB WorkItem/RootWorkItem.
3. Add CAB and DevExpress references
- Using NuGet or package manager, add or update:
- Microsoft.Practices.CompositeUI (or your CAB package)
- DevExpress.Win and related DevExpress assemblies matching your installed DevExpress version
- In each project that uses DevExpress controls, add references to the appropriate DevExpress assemblies (e.g., DevExpress.XtraEditors, DevExpress.XtraBars, DevExpress.XtraGrid).
- Verify Copy Local and bindingRedirects in app.config if necessary.
4. Install the CAB DevExpress Extension Kit
- If the Extension Kit is distributed as a NuGet package:
- In Package Manager Console: Install-Package CAB.DevExpress.ExtensionKit (or the actual package name).
- Confirm package added to projects that require it (module projects and the shell project).
- If provided as an installer or ZIP:
- Extract or run installer; copy extension assemblies into a shared libs folder.
- Add project references to those assemblies.
5. Register extension components in the shell
- In your WinForms shell (the startup application), register extension services and controllers during startup before UI creation:
- Initialize any DevExpress skin/theme managers if required.
- Register the Extension Kit’s service or module loader with your RootWorkItem or ServiceLocator.
- Example sequence (conceptual):
- Configure DevExpress skins (SkinManager.EnableFormSkins()).
- RootWorkItem.Services.AddNew
(); - ModuleLoader.Initialize(rootWorkItem);
6. Configure modules to use DevExpress extension features
- In module initialization (ModuleInit or WorkItem/Module OnRun):
- Request the DevExpress extension service from the work item.
- Use the extension’s helpers to create or wrap views with DevExpress controls (ribbon, dock panels, grids).
- Replace standard WinForms controls with DevExpress equivalents in user controls and forms where you want the enhanced UI and behaviors.
7. Hook up UI composition and docking
- If the Extension Kit provides dock/ribbon integration:
- Create or configure a DevExpress DockManager or RibbonControl in the shell form.
- Expose these controls to modules (via services or events) so modules can add pages, dock panels, or toolbars.
- Use the Extension Kit’s adapters to host module views inside DevExpress containers.
8. Configure themes, skins, and appearance
- Initialize global skins early in application startup:
- Call DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(“Office 2019 Colorful”) or use SkinManager.
- If the Extension Kit provides theme syncing across modules, enable it through the kit’s configuration API so modules automatically adopt the shell skin.
9. Resolve common configuration issues
- Version mismatches: Ensure DevExpress assemblies referenced by the kit and your projects match the installed DevExpress version. Use bindingRedirects in app.config if necessary.
- Missing assemblies at runtime: Verify all required assemblies are copied to the output folder; set Copy Local = true or use a post-build step.
-
Leave a Reply