ModuleBase.GetXafResourceLocalizerTypes() Method
Returns a collection of Resource Localizer types that can be used in an application that uses the current module.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Returns
Type | Description |
---|---|
ICollection<Type> | An ICollection<Type> collection containing the types of the Resource Localizers to be supplied with the current module. |
Remarks
Each Developer Express component or library has a specific Localizer class (see the table below) that provides localized strings for this component/library. If your distributable module uses a control from one of the DevExpress libraries, you can supply a Resource Localizer with the module. In this instance, the control’s resources can be localized via the IModelLocalization node in the Model Editor in any application that uses your module. To introduce a Resource Localizer, inherit it from a corresponding Localizer class and implement the IXafResourceLocalizer interface. All the necessary DevExpress localizers are listed in the Localizing WinForms Controls via Localizer Objects document. To learn how to implement the IXafResourceLocalizer interface, see the XAF sources.
To register a custom Resource Localizer in your module, override the GetXafResourceLocalizerTypes method. See an example:
public class Module : ModuleBase {
public override ICollection<Type> GetXafResourceLocalizerTypes() {
ICollection<Type> result = new List<Type>();
result.Add(typeof(GridControlLocalizer));
result.Add(typeof(LayoutControlLocalizer));
return result;
}
//...
}
The Resource Localizers that are registered in the modules used in an application can be selected in the Application Designer, using the XafApplication.ResourcesExportedToModel property:
In this instance, the Application Model’s IModelLocalization node will contain the child nodes that correspond to the selected resources: