Skip to main content
A newer version of this page is available. .
All docs
V21.2
.NET 5.0+
  • The page you are viewing does not exist in the .NET Framework 4.5.2+ platform documentation. This link will take you to the parent topic of the current section.
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.

IXafCultureInfoService Interface

Declares members of a localization service.

Namespace: DevExpress.ExpressApp.Blazor.Services

Assembly: DevExpress.ExpressApp.Blazor.v21.2.dll

NuGet Package: DevExpress.ExpressApp.Blazor

Declaration

public interface IXafCultureInfoService

Remarks

XAF features a built-in implementation of the IXafCultureInfoService interface.

Example

The code sample below demonstrates how to use IXafCultureInfoService to change the application localization.

using DevExpress.ExpressApp; 
using DevExpress.ExpressApp.Actions; 
using DevExpress.ExpressApp.Blazor; 
using DevExpress.ExpressApp.Blazor.Services; 
using DevExpress.Persistent.Base; 

namespace MainDemo.Module.Blazor.Controllers { 
    public class GermanCultureController : ViewController { 
        BlazorApplication BlazorApplication => (BlazorApplication)Application; 
        IXafCultureInfoService CultureInfoService => (IXafCultureInfoService)BlazorApplication.ServiceProvider.GetService(typeof(IXafCultureInfoService)); 
        public GermanCultureController() { 
            SimpleAction myAction = new SimpleAction(this, "SetGermanCulture", PredefinedCategory.Edit); 
            myAction.Execute += async (s, e) => await CultureInfoService.SetCultureAsync("de"); 
        } 
    } 
} 
See Also