IMPORTANT: This article lists feature toggles for XAF applications of v20.1 and earlier versions. We no longer update this article. For information on feature toggles in applications of v20.2 and later versions, refer to the following property description: FrameworkSettings.DefaultSettingsCompatibilityMode.
FrameworkSettings.DefaultSettingsCompatibilityMode Option
In v20.2, we implemented the DevExpress.ExpressApp.FrameworkSettings.DefaultSettingsCompatibilityMode property that enables configuration options and feature toggles specific to the version of your application. You can set this property to the DevExpress.ExpressApp.FrameworkSettingsCompatibilityMode enumeration value in the YourSolutionName.XXX\Program.xx, YourSolutionName.Web\Global.asax.xx, or YourSolutionName.Blazor.Server\Program.cs file of your application. For more information, refer to the following article: FrameworkSettings.DefaultSettingsCompatibilityMode sets default XAF configuration options and feature toggles. Available since v20.2.2.
This article lists configuration options and settings that are specified in code generated by the most recent Solution Wizard version. In most cases, these options are feature toggles used to enable new features and functionality without affecting the existing applications behavior. If your XAF application is created using an older version of the Solution Wizard, you can review the list below and enable required features manually.
UI-Independent or Platform-Agnostic Options
In the YourSolutionName.XXX\XXXApplication.xx files, feature toggles are mostly grouped in the “Default XAF configuration options” region.
BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType Field
Certain Object Space methods have the System.Type parameters. The static BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType field indicates whether these methods throw ArgumentException when a passed type is not registered in the Object Space Provider's entity store. Set this field to true to diagnose issues related to the incorrect use of the Object Space type (for example, when a persistent Object Space is used to manipulate non-persistent objects). Available since v19.2.4.
C#DevExpress.ExpressApp.BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType = true;
Security Permissions Caching
In the YourSolutionName.Wxx/Program.xx/Global.asax.xx file, the Security System uses Security Adapters to process and cache security permission requests. These methods from the Program.Main method enable Security Permissions Caching. Available since v19.1.4.
C#security.RegisterXPOAdapterProviders();
XafApplication.OptimizedControllersCreation Property
When the XafApplication.OptimizedControllersCreation property is set to true, View Controllers that won't be activated due to ViewController.TargetViewType ViewController.TargetViewNestingViewController.TargetObjectType or ViewController.TargetViewId restrictions are not created in nested List Views. Available since v16.2.6.
C#this.OptimizedControllersCreation = true;
Password Cryptography Options
XAF applications do not store user passwords as plain text. Instead, the derived hash is created from the password using the Rfc2898DeriveBytes or SHA512 class. The behavior is specified using the static EnableRfc2898 and SupportLegacySha512 properties of the DevExpress.Persistent.Base.PasswordCryptographer class. For details, refer to the Access Passwords in Code section of the Passwords in the Security System topic. Available since v16.2.5.
C#DevExpress.Persistent.Base.PasswordCryptographer.EnableRfc2898 = true;
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = false;
XafApplication.LinkNewObjectToParentImmediately Property
The XafApplication.LinkNewObjectToParentImmediately property specifies whether or not the link between a master and a child object is created immediately when the NewObjectViewController.NewObjectAction is being executed in a nested List View with a non-aggregated collection. Available since v15.2.2.
C#this.LinkNewObjectToParentImmediately = false;
XafApplication.CheckCompatibilityType Property
The XafApplication.CheckCompatibilityType property specifies how the database and application compatibility is checked. This property is visible in the Application Designer and thus is initialized in the “Component Designer generated code” region. Available since v15.2.2.
C#this.CheckCompatibilityType = DevExpress.ExpressApp.CheckCompatibilityType.DatabaseSchema;
Database Storage for Model Differences
In the YourSolutionName.Module.Wxx\XXXModule.cs file, the XafApplication.CreateCustomUserModelDifferenceStore event is handled in order to store the Application Model differences, separately for each user using the Database Storage. Available since v14.2.2.
C#public override void Setup(XafApplication application) {
base.Setup(application);
application.CreateCustomUserModelDifferenceStore +=
Application_CreateCustomUserModelDifferenceStore;
}
private void Application_CreateCustomUserModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) {
e.Store = new ModelDifferenceDbStore((XafApplication)sender,
typeof(ModelDifference), false, "Win"); // In ASP.NET module, pass 'Web' as the contextId
e.Handled = true;
}
CalculatedPersistentAliasHelper.CustomizeTypesInfo Method
In the YourSolutionName.Module.xx file, the static CalculatedPersistentAliasHelper.CustomizeTypesInfo method is used to process the CalculatedPersistentAlias attribute applied to an XPO persistent class. See the How to: Change the Format Used for the FullAddress and FullName Properties example. Available since v12.1.4.
C#public override void CustomizeTypesInfo(ITypesInfo typesInfo) {
base.CustomizeTypesInfo(typesInfo);
CalculatedPersistentAliasHelper.CustomizeTypesInfo(typesInfo);
}
BaseObject.OidInitializationMode Property
In the YourSolutionName.Module.xx file, the BaseObject.OidInitializationMode property in the module’s constructor specifies that the unique identifier is immediately assigned to a newly created XPO persistent object. Available since v10.2.6.
C#BaseObject.OidInitializationMode = OidInitializationMode.AfterConstruction;
Blazor UI Options
Security System Configuration as a Startup Service
In the YourSolution.Blazor.Server\Startup.cs file, the Security System is initialized in the Startup.ConfigureServices method as a service instead of the BlazorApplication constructor in v20.1. For more information, see Blazor - The Security System is initialized as a service in ConfigureServices instead of BlazorApplication. Available since v20.2.2.
C#using DevExpress.ExpressApp.Security;
using DevExpress.Persistent.BaseImpl.PermissionPolicy;
// ...
public class Startup {
// ...
public void ConfigureServices(IServiceCollection services) {
// Initialize the Security System
services.AddXafSecurity(options => {
options.RoleType = typeof(PermissionPolicyRole);
options.UserType = typeof(PermissionPolicyUser);
options.Events.OnSecurityStrategyCreated = securityStrategy => ((SecurityStrategy)securityStrategy).RegisterXPOAdapterProviders(); // for XPO applications only
}).AddAuthenticationStandard().AddExternalAuthentication<HttpContextPrincipalProvider>();
}
}
WinForms UI Options
In addition to the platform-agnostic options listed in the previous section, the following WinForms specific options are mostly available in the YourSolutionName.Win\WinApplication.xx file.
DetailView.UseAsyncLoading Field
The static DetailView.UseAsyncLoading field specifies whether the IModelAsync.UseAsyncLoading property is visible in the Model Editor. Available since v20.1.2.
C#DetailView.UseAsyncLoading = true;
DPI-Aware Setting
In the YourSolutionName.Win\App.config file, new XAF WinForms applications have the DPI-Aware mode is turned on by default through DevExpress Project Settings. Available since v18.2.7.
WindowsFormsSettings.LoadApplicationSettings Method
In the YourSolutionName.Win\Program.xx file, the static WindowsForms.Settings.LoadApplicationSettings method called from the Program.Main method and loads the DevExpress Project Settings. This method is called before creating a WinApplication descendant instance to enable DPI-Aware mode in time. Available since v18.2.7.
C#WindowsFormsSettings.LoadApplicationSettings();
WinApplication.SplashScreen and WinApplication.EnableStartupLogicBeforeClosingLogonWindows Properties
The WinApplication.SplashScreen property is initialized with a DXSplashScreen instance by default. This splash screen shows the XafSplashScreen form during loading and a default Overlay Form in front of a Logon Form. When the WinApplication.ExecuteStartupLogicBeforeClosingLogonWindow property is set to true, the Logon Form is displayed until the startup window is shown. If this property is set to false, the Logon Form is closed after a successful logon. Available since v18.2.6.
C#SplashScreen = new DXSplashScreen(typeof(XafSplashScreen), new DefaultOverlayFormOptions());
ExecuteStartupLogicBeforeClosingLogonWindow = true;
If you don't need the default splash forms remove these code lines and the XafSplashScreen form from your XAF application. To use custom splash forms, modify this code as described at How to: Use a Custom Splash Screen.
ImageLoader.UseSvgImages Property
The ImageLoader.UseSvgImages property enables SVG images in applications. Available since v18.2.2.
C#DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;
Hidden Images in Accordion Navigation, Layout Groups and Tabbed MDI
In the YourSolutionName.Win\Model.xafml file, Solution Wizard overrides the default navigation style, UI type and other options to provide more modern look-and-feel for new XAF projects. Available since v18.2.2.
XML<Application Logo="ExpressAppLogo">
<Options UIType="TabbedMDI" FormStyle="Ribbon" />
<NavigationItems NavigationStyle="Accordion" ShowImages="False" DefaultChildItemsDisplayStyle="List"/>
<Options ShowTabImage="False">
<LayoutManagerOptions EnableLayoutGroupImages="False" />
</Options>
</Application>
WinApplication.UseLightStyle Property
The WinApplication.UseLightStyle property enables the Light Style form templates. The Light Style layout is cleaner as it eliminates excessive borders. Available since v18.1.2.
C#UseLightStyle = true;
New WinForms Templates
In the YourSolutionName.Win/WinApplication.designer.xx file, the Solution Wizard enables new MainForm and DetailForm templates for all XAF WinForms applications. Available since v14.2.2.
C#this.UseOldTemplates = false;
We recommend using new templates when possible. We no longer fix bugs and develop new features for old templates. As an exception, we fixed a known issue in v20.1.7: WinForms - A focused editor's value is not posted or reset after clicking Save when UseOldTemplates is True.
WinReportServiceController.UseNewWizard Property
The WinReportServiceController.UseNewWizard property specifies if the Report Wizard with enhanced skins support and optimized for high DPI displays is used. Available since v16.2.2.
C#DevExpress.ExpressApp.ReportsV2.Win.WinReportServiceController.UseNewWizard = true;
ASP.NET WebForms Options
The following ASP.NET WebForms-specific options are mostly available in the YourSolutionName.Web\WebApplication.xx file.
User-Friendly URLs for Views
ViewUrlManager implements the built-in User-Friendly URLs mechanism. To enable classic route functionality, use ViewUrlHashManager or just remove the CreateViewUrlManager method. Available since v19.1.3.
C#protected override IViewUrlManager CreateViewUrlManager() {
return new ViewUrlManager();
}
Additionally, you need to remove the following line from the Application_Start method of the YourSolutionName.Web\Global.asax.xx file.
C#RouteTable.Routes.RegisterXafRoutes();
ASPxColorPickerPropertyEditor Property Editor
In the YourSolutionName.Module.Web\Model.DesignedDiffs.xafml file, the EditorType property of the ViewItems | PropertyEditors | System.Drawing.Color node specifies that the ASPxColorPickerPropertyEditor property editor should be used for Color Properties instead of the legacy ASPxColorPropertyEditor. Available since v17.1.2.
XML<ViewItems>
<PropertyEditor Name="PropertyEditors">
<RegisteredPropertyEditor PropertyType="System.Drawing.Color"
EditorType="DevExpress.ExpressApp.Web.Editors.ASPx.ASPxColorPickerPropertyEditor" />
</PropertyEditor>
</ViewItems>
WebApplication.EnableMultipleBrowserTabsSupport Property
When the static EnableMultipleBrowserTabsSupport property is set to true, each loaded web window has a unique identifier within the ASP.NET session. By using these window identifiers, all requests are correctly routed on the server side. Available since v16.1.8+.
C#WebApplication.EnableMultipleBrowserTabsSupport = true;
RequiredFieldMark Property
In the YourSolutionName.Module\Model.DesignedDiffs.xafml file, the RequiredFieldMark property of the Options | LayoutManagerOptions node specifies the localizable character or string which is appended to the field label when the RuleRequiredField rule demands a field to have a value. Available since v15.2.2.
XML<Options>
<LayoutManagerOptions RequiredFieldMark="*" />
</Options>
Filter Control Hierarchy Options
When you edit criteria using the Visual tab, you can either select object properties in a plain list or in the tree-like structure (which makes referenced objects' properties available). For details, see the Criteria Property Editors Options in ASP.NET Applications section in the Criteria Properties. Similar ASPxGridListEditor options adjust the behavior of the grid's filter control: ASPxGridListEditor.AllowFilterControlHierarchy and ASPxGridListEditor.MaxFilterControlHierarchyDepth. Available since v15.2.2.
C#DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridListEditor.AllowFilterControlHierarchy = true;
DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridListEditor.MaxFilterControlHierarchyDepth = 3;
DevExpress.ExpressApp.Web.Editors.ASPx.ASPxCriteriaPropertyEditor.AllowFilterControlHierarchyDefault = true;
DevExpress.ExpressApp.Web.Editors.ASPx.ASPxCriteriaPropertyEditor.MaxHierarchyDepthDefault = 3;
WebApplication.SwitchToNewStyle Method
In the YourSolutionName.Web\Global.asax.xx file, the WebApplication.SwitchToNewStyle method enables the new web UI optimized for touch devices and was introduced in v15.1.5.
C#protected void Session_Start(Object sender, EventArgs e) {
// ...
WebApplication.SetInstance(Session, new Solution23AspNetApplication());
// ...
WebApplication.Instance.SwitchToNewStyle();
// ...
}
Maybe you want to add:
ModelCacheManager.UseMultithreadedLoading = true; ModelCacheManager.SkipEmptyNodes = true;
Hello Fabio,
These options are not accessed in the default generated code, and thus they are not the subject of this KB article. Model Cache is designed to be enabled manually, when required. We do not recommend enabling it unless you experience the lack of startup performance.