WPF: custom regional settings

I just found out that WPF will ignore CultureInfo.CurrentCulture and always use en-US. I also found a wonderful answer here . Everything worked fine until one of the users set up the regional settings to change the currency symbol (here in the Philippines, you can write Php and P, and most people prefer P, by default Php). It seems that the application is not suitable for this. Is there any way around this?

+2
source share
3 answers

After a two-week study of two people, I think there is currently no way to do this using the globalization classes.

CurrentUICulture and other related classes contain standard formats / settings for the selected language, but not configured parameters.

One way to do this is to read the values ​​directly from the HKCU \ Control Panel \ International registry key.

0
source

Recently, I needed to check the current country setting for my C # WPF application. I used CurrentCulture, not CurrentUICulture (which took EN-US for me).

Also, I'm not sure if this will help, but I found out that I tested this feature in the wrong place.

To change the country of your application for testing, follow the link: "Control Panel β†’ Clock, Language and Region", select the "Region and Language" button, a window will open, go to the format tab, change the country in the format list.

Once I did this, CurrentCulture worked fine.

+2
source

Yes, there is a way to force WPF to use custom regional settings, but you need to force all bindings to use CultureInfo.CurrentCulture . See this post for examples.

0
source

All Articles