Boost Your WinForms Development with the CAB DevExpress Extension Kit

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

  1. Close Visual Studio.
  2. Ensure DevExpress components are installed and registered (run the DevExpress installer if needed).
  3. 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

  1. Open Visual Studio and create a new Windows Forms solution or open your existing CAB solution.
  2. 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

  1. 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
  2. In each project that uses DevExpress controls, add references to the appropriate DevExpress assemblies (e.g., DevExpress.XtraEditors, DevExpress.XtraBars, DevExpress.XtraGrid).
  3. Verify Copy Local and bindingRedirects in app.config if necessary.

4. Install the CAB DevExpress Extension Kit

  1. 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).
  2. 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

  1. 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.
  2. Example sequence (conceptual):
    • Configure DevExpress skins (SkinManager.EnableFormSkins()).
    • RootWorkItem.Services.AddNew();
    • ModuleLoader.Initialize(rootWorkItem);

6. Configure modules to use DevExpress extension features

  1. 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).
  2. 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

  1. 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.
  2. Use the Extension Kit’s adapters to host module views inside DevExpress containers.

8. Configure themes, skins, and appearance

  1. Initialize global skins early in application startup:
    • Call DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(“Office 2019 Colorful”) or use SkinManager.
  2. 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.
    -​

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *