Back to Devexpress

XafApplication.CustomizeFormattingCulture Event

expressappframework-devexpress-dot-expressapp-dot-xafapplication-b39277c5.md

latest5.5 KB
Original Source

XafApplication.CustomizeFormattingCulture Event

Occurs after a formatting culture has been set internally.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public event EventHandler<CustomizeFormattingCultureEventArgs> CustomizeFormattingCulture
vb
Public Event CustomizeFormattingCulture As EventHandler(Of CustomizeFormattingCultureEventArgs)

Event Data

The CustomizeFormattingCulture event's data class is CustomizeFormattingCultureEventArgs. The following properties provide information specific to this event:

PropertyDescription
FormattingCultureSpecifies the culture currently set for the application.
PreferredLanguageNameSpecifies the language currently set for the Application Model‘s IModelApplication.PreferredLanguage property.
UserLanguageNameSpecifies the language which is set in the user’s operating system or passed by the Internet browser.

Remarks

In XAF applications, formatting options for information like currency, numbers, and dates are not related to the application’s language. The formatting options that are set in the current user’s operating system or passed by the Internet browser are used. Handle this event to set the required formatting culture for the Thread.CurrentCulture object. To get the culture currently set, use the handler’s CustomizeFormattingCultureEventArgs.FormattingCulture property. In addition, you can get the language which is set in the user’s operating system or passed by the Internet browser. For this purpose, use the handler’s CustomizeFormattingCultureEventArgs.UserLanguageName property. To get the language which is currently set for the IModelApplication node’s IModelApplication.PreferredLanguage property, use the handler’s CustomizeFormattingCultureEventArgs.PreferredLanguageName property.

To see an example of handling this event, refer to the Culture-Specific Formatting topic.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomizeFormattingCulture event.

Note

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.

xaf-separate-employees-data-in-different-departments-using-security-permissions/CS/MainDemo.Win/Program.cs#L21

csharp
#endif
            winApplication.CustomizeFormattingCulture += new EventHandler<CustomizeFormattingCultureEventArgs>(winApplication_CustomizeFormattingCulture);
            try {

xaf-separate-employees-data-in-different-departments-using-security-permissions/VB/MainDemo.Win/Program.vb#L18

vb
EasyTestRemotingRegistration.Register()
AddHandler winApplication.CustomizeFormattingCulture, New EventHandler(Of CustomizeFormattingCultureEventArgs)(AddressOf winApplication_CustomizeFormattingCulture)

See Also

CustomizeLanguage

Localization Basics

XafApplication Class

XafApplication Members

DevExpress.ExpressApp Namespace