All the articles on the internet suggest that to make the XAML binding detect the selected culture in the operating system, this line should be used.
FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata((XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))));
The problem is that the regional settings in windows allow the user to customize the formatting of dates and numbers in any way the user wants. For example, lets say that the user wants to 3 decimal digits instead of 2. he goes to the regional settings and makes this update. The problem is that this change is not picked up in Xaml binding
<TextBlock Text="{Binding Payments, StringFormat=C}" /> <!--display 2 digits-->
Oddly enough, in the code behind, if i use ToString("C") i will successfully get whatever customization i did on the server side.
decimal sampleNumber = 1.123;
string s = sampleNumber.ToString("C"); //Puts 3 digits in the string variable
My workaround is to use a custom converter where i do the ToString and return the string to the binding. But it is weird that i haven't seen this problem (which is most probably a bug in WPF) posted anywhere on the net. Am i missing something?