In App.xaml.cs I have:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement),
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(
CultureInfo.CurrentCulture.IetfLanguageTag)));
In my MainWindow.xaml.cs I have:
NumberFormatInfo nfi = System.Threading.Thread.CurrentThread
.CurrentCulture.NumberFormat;
nfi.CurrencySymbol = "USD";
nfi.CurrencyDecimalSeparator = ".";
nfi.CurrencyDecimalDigits = 0;
NumberFormatInfo nfi = System.Threading.Thread.CurrentThread
.CurrentUICulture.NumberFormat;
nfi.CurrencySymbol = "USD";
nfi.CurrencyDecimalSeparator = ".";
nfi.CurrencyDecimalDigits = 0;
Now in a different window, which will be opened from the MainWindow, I wrote the following:
<TextBox Text="{Binding Total, StringFormat=c}"
But the result is something like $1,200.00, not what I expected: USD1,200. What's wrong here?