Skip to main content
.NET Framework 4.6.2+

XafApplication.ResourcesExportedToModel Property

Provides access to a collection of Resource Localizers used in the current application to extend the Application Model’s IModelLocalization node.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public List<Type> ResourcesExportedToModel { get; set; }

Property Value

Type Description
List<Type>

An IList<Type> collection of Resource Localizer types.

Remarks

The most recommended way to localize your application is described in the How to: Localize an XAF Application topic.

By default, the Localization node allows you to localize internal XAF resources only. However, you can extend this node with child nodes that will allow you to localize the resource strings of the required control used in your application. There are several ways to do this:

  • At design-time

    Invoke the Application Designer. In the Properties window, press the ellipsis button of the ResourcesExportedToModel property. In the invoked dialog, check the resources you want to localize. Submit the selection by pressing the OK button.

    ResourceLocalizers

  • In code

    Add the required Resource Localizers to the collection returned by the ResourcesExportedToModel property.

    In a Windows Forms application:

    public class Program {
       public static void Main(string[] arguments) {
          MySolutionWinApplication winApplication = new MySolutionWinApplication();
          //...      
          winApplication.ResourcesExportedToModel.Add(typeof(
             DevExpress.ExpressApp.Win.Localization.GridControlLocalizer));
          winApplication.Setup();
          //...
       }
    }
    

    In an ASP.NET Web Forms application:

    public class Global : System.Web.HttpApplication {
       protected void Session_Start(object sender, EventArgs e) {
          WebApplication.SetInstance(Session, new MySolutionWebApplication());
          //...      
          WebApplication.Instance.ResourcesExportedToModel.Add(
             typeof(DevExpress.ExpressApp.Web.Localization.ASPxGridViewControlLocalizer));
          WebApplication.Instance.Setup();
          //...
       }
    }
    

Invoke the Model Editor for the current application project. In the Localization node, you will find child nodes corresponding to the added resources. Here, you can localize them, as with any other resources in XAF (see Localization Basics and Localize UI Elements):

ResourceLocalizers_Model

To learn how to use a ready-to-use satellite assembly with strings translated to the required language, refer to the Localize Standard XAF Modules and DevExpress Controls Used in an Application topic.

See Also