Back to Devexpress

Create and Register a Custom XAF Module

expressappframework-405523-app-shell-and-base-infrastructure-application-solution-components-modules-create-and-register-custom-xaf-module.md

latest3.0 KB
Original Source

Create and Register a Custom XAF Module

  • Feb 13, 2026
  • 3 minutes to read

XAF allows you to implement custom modules in your application and to reuse these modules in other XAF applications.

Create a Common Cross-Platform XAF Module

An XAF module is a class library that contains a class derived from ModuleBase. You can use the Template Kit to create an XAF project with a cross-platform module and reuse this module in your application.

  1. Use the DevExpress Template Kit or CLI template to create a new solution. Specify the same initial settings (such as framework version and ORM) as in your existing project.
    The new solution includes several modules: platform-specific application projects (NewSolutionName.Blazor.Server or/and NewSolutionName.Win) and a common module (NewSolutionName.Module).
  2. Copy the NewSolutionName\NewSolutionName.Module folder from the new solution to your solution.
  3. Add the new module project to your solution. Right-click the solution name in the Solution Explorer, select Add | Existing Project… , and choose SolutionName\NewSolutionName.Module\NewSolutionName.Module.csproj.

Tip

Alternatively, you can define a ModuleBase class descendant to convert an existing Class Library into a module. Take the Module.cs file from an existing module as a prototype. Rename this class and set the correct namespace.

Do not inherit from modules. ModuleBase class descendants should be sealed.

Register a Module in the XAF Application

  1. Add a reference to the new module project.

  2. You can register a custom module in the main module project or in platform-specific projects.

Note

This help topic describes how to add a common cross-platform module to your application. If you need to implement platform-specific logic, for instance, implement a property editor based on a custom component (Blazor) or display a custom data-bound control in an XAF View, use platform-specific application projects — SolutionName.Blazor.Server or SolutionName.Win.

See Also

Tutorial: Create a .NET class library using Visual Studio