WPF controls don't seem to have a .Culture
property, or any other obvious way of controlling how text is localised. Worse, on my test machine it doesn't even respect the system locale. My application needs to work for Germans, so the test machine runs a German version of windows and C# respects this. Thus
String.Format('{0}', 3.5) == "3,5"
But if I leave the localisation to WPF, e.g. by binding a numeric property directly to a label or a datagrid cell, I see some kind of American formatting. So if I format 3.5
as currency then I would see $3.50
on-screen.
So:
- Why does WPF use the wrong locale?
- How do I fix it?
Ideally "fix" means making it respect the system locale by default, while giving me explict control over particular things. Thus if I have a German invoice opened on an Australian PC, the ideal thing would be for a price to look like €3.50
.