3

Is there a centralized way to have the WPF UI to respect the customized decimal separator set in Control Panel -> Regional Settings?

When I bind a double valued data to a text box, I want to enter the value using the decimal separator set in Regional settings.

The code below (when put in App's ctor) will use the decimal separator of the current culture settings, but will not respect the customized decimal separator setting. I was hoping that this code could somehow easily be exteded to cover the customized decimal separator as well.

FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement),
             new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
friskm
  • 366
  • 3
  • 7
  • Seems that this is a recognized issue in [MS Connect](http://connect.microsoft.com/VisualStudio/feedback/details/552045/wpf-culture-date-and-number-formats). Go and vote if you feel this is an important issue. – friskm Apr 30 '11 at 07:42

2 Answers2

0

Perhaps a bit late but I found this when researching my own formating problem.

The name "CultureInfo.UseUserOverride" is pretty self explanatory.

MAS
  • 21
  • 3
0

Have you tried using StringFormat in your binding?

jv42
  • 8,521
  • 5
  • 40
  • 64
  • Yes, I have but the custom decimal separator setting is not used from regional settings with StringFormat either. – friskm Apr 26 '11 at 15:39
  • Too bad :( You can play with the setting in StringFormat using ConverterCulture, but I don't see how you could set it to current culture. – jv42 Apr 26 '11 at 15:55
  • Why don't you use a special converter which uses the current culture? – Ε Г И І И О Nov 07 '11 at 12:38