Skip to main content

Register a Built-in XAF Module

  • 3 minutes to read

XAF includes a number of ready-to-use built-in modules. This topic describes how to register a built-in module in a new or existing XAF application.

Register a Built-in XAF Module in an Existing .NET Application

  1. Install the NuGet package that contains the module.
  2. Navigate to the MyApplication.Blazor.Server\Startup.cs (Blazor) or MyApplication.Win\Startup.cs (WinForms) file and call the module-related Add* method to register the module.

The following code samples register Reports, Dashboards, and Office modules in the application.

public class Startup {
   // ...
   public void ConfigureServices(IServiceCollection services) {
         // ...
         services.AddXaf(Configuration, builder => {
            // ...
            builder.Modules
               .AddReports(/*...*/)
               .AddDashboards(/*...*/)
               .AddOffice(/*...*/)
            // ...
         });
   }
}
Display the list of module NuGet packages and AddModule methods
Module NuGet Packages Module-Related Methods
Audit Trail Module DevExpress.ExpressApp.AuditTrail.EFCore
DevExpress.ExpressApp.AuditTrail.Xpo
AddAuditTrailEFCore
AddAuditTrailXpo
Chart Module DevExpress.ExpressApp.Chart.Win AddCharts (WinForms)
Clone Object Module DevExpress.ExpressApp.CloneObject
DevExpress.ExpressApp.CloneObject.Xpo
AddCloning
ConditionalAppearance DevExpress.ExpressApp.ConditionalAppearance AddConditionalAppearance
Dashboards Module DevExpress.ExpressApp.Dashboards.Blazor
DevExpress.ExpressApp.Dashboards.Win
AddDashboards (Blazor)
AddDashboards (WinForms)
File Attachments Module DevExpress.ExpressApp.FileAttachment.Blazor
DevExpress.ExpressApp.FileAttachment.Win
AddFileAttachments (Blazor)
AddFileAttachments (WinForms)
Multi-Tenancy (Data per Tenant) Module DevExpress.ExpressApp.MultiTenancy.Blazor.EFCore
DevExpress.ExpressApp.MultiTenancy.Blazor.XPO
DevExpress.ExpressApp.MultiTenancy.Win.EFCore
DevExpress.ExpressApp.MultiTenancy.Win.XPO
AddMultiTenancy (EF Core Blazor)
AddMultiTenancy (XPO Blazor)
AddMultiTenancy (EF Core WinForms)
AddMultiTenancy (XPO WinForms)
Notifications Module DevExpress.ExpressApp.Notifications.Blazor
DevExpress.ExpressApp.Notifications.Win
AddNotifications (Blazor)
AddNotifications (WinForms)
Office Module DevExpress.ExpressApp.Office.Blazor
DevExpress.ExpressApp.Office.Win
AddOffice (Blazor)
AddOffice (WinForms)
Pivot Grid Module DevExpress.ExpressApp.PivotGrid.Win AddPivotGrid (WinForms)
Reports V2 Module DevExpress.ExpressApp.ReportsV2.Blazor
DevExpress.ExpressApp.ReportsV2.Win
AddReports (Blazor)
AddReports (WinForms)
Scheduler Module DevExpress.ExpressApp.Scheduler.Blazor
DevExpress.ExpressApp.Scheduler.Win
AddScheduler (Blazor)
AddScheduler (WinForms)
State Machine Module DevExpress.ExpressApp.StateMachine AddStateMachine
TreeList Editors Module DevExpress.ExpressApp.TreeListEditors.Win AddTreeListEditors (WinForms)
Validation Module DevExpress.ExpressApp.Validation.Blazor
DevExpress.ExpressApp.Validation.Win
AddValidation (Blazor)
AddValidation (WinForms)
View Variants Module DevExpress.ExpressApp.ViewVariantsModule AddViewVariants

Register a Module in the Module Project

You can use the ModuleBase.RequiredModuleTypes property to specify required dependencies for your module. XAF loads these dependent modules with the current module. Follow the steps below to register additional modules in the Module project:

  1. Install the NuGet package that contains the module to register.
  2. Add additional modules to the RequiredModuleTypes list in the MyApplication.Module\Module.cs file.
public sealed class _MyApplicationModule : ModuleBase {
   //...
   public _MyApplicationModule() {
      InitializeComponent();
      this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.SystemModule.SystemModule));
      this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ReportsV2.ReportsModuleV2));
      this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.Dashboards.DashboardsModule));
      this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.Office.OfficeModule));
      // ...
   }
}

Add a Built-in XAF Module in a New .NET Application

You can add modules to your application when you use the Template Kit to create a new XAF solution. Select modules in the Additional Modules section.

XAF Template Kit Additional Modules section

See Also