Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

XafApplication Class

Manages an XAF application.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.2.dll


public abstract class XafApplication :


The XafApplication class has methods to create Controllers, Views, Object Space(see BaseObjectSpace) and other XAF elements. Its properties provide the application name and title, configuration string, access to the Application Model, modules and the strategy that manages the View display. You can customize many built-in mechanisms for managing the application. For this purpose, use the XafApplication‘s events.

Since the XafApplication object can be useful at many points in your code, it must be easily accessed. The following properties provide access to the current application: ActionBase.Application, Controller.Application, Frame.Application, CustomizePopupWindowParamsEventArgs.Application, CreateCustomTemplateEventArgs.Application, etc.

The XafApplication class’ descendant is automatically created and initialized in both ASP.NET Web and Windows Forms applications, as well as in the Application Server service. In an ASP.NET application, it is created and initialized when a session starts; in a Windows Forms applications - in the Main method; in an Application Server service - in the ApplicationServerService constructor. See the Global.asax.cs (Global.asax.vb), Program.cs (Program.vb) and ApplicationServerService.cs (ApplicationServerService.vb) files respectively.

To configure your application, use the Application Designer (not available for the Application Server). The settings that you cannot set in the Designer can be set via one of the XafApplication.Setup method overloads, or by specifying properties between the application’s creation and setup.

The following code snippets (auto-collected from DevExpress Examples) contain references to the XafApplication class.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Extension Methods

See Also