Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
670
XamCurrencyEditor Language problem
posted

Hi,

I've create a new XamCurrency Editor like this to take the current culture :

 

 

 

public

 

 

class XamCurrencyEditor : Infragistics.Windows.Editors.

XamCurrencyEditor

 

{

 

 

public

XamCurrencyEditor()

{

 

 

this.Language = System.Windows.Markup.XmlLanguage.GetLanguage(System.Globalization.CultureInfo

.CurrentUICulture.IetfLanguageTag);

But Text value Binding Doesn't work always ("0,00€" is not visible).

An issue ? Thanks

 

 

  • 8607
    Offline posted

    Hello MICASOFT,

    Has this issue been addressed?

    In WPF, the CultureInfo defaults to en-US.  Please refer to this forum post for more information.

    There are a couple of ways to change the CultureInfo on the application.

    1. You can set the Language attribute of the default WPF Grid:

    <Grid Language="fr-FR">

    This is hardcoding and is not recommended.

    2. You can set the App.xaml.cs file to use the system's locale.  The System.Windows.Markup and System.Globalization references need to be included.

    public App()

            {

                FrameworkElement.LanguageProperty.OverrideMetadata(

                  typeof(FrameworkElement),

                  new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(

    CultureInfo.CurrentCulture.IetfLanguageTag)));

            }

     

    I tried this out with an Infragistics XamCurrencyEditor.  I set the Language property to "fr-FR" (for example) to see what the currency editor would look like.  I have attached a screenshot of what it looks like.

    Another option is to use a XamMaskedEditor.  You will have much more control over the format of the input by setting the mask.  You can place the currency symbol after the input, and specify the "," as the dividing symbol.  Please see this topic for more information about masks.

     

    Elizabeth Albert

    Localization Engineer