I've got an application where I need to show a price, for that, I have the following code:
<Label Content="{Binding Prijs}" ContentStringFormat="C"></Label>
However, that gives a stringformat like: $10.00, but i want to show the euro-sign (€) instead of the dollar-sign ($). How do I do that?
You need to make sure that the Language
of the control is set correctly.
Tim Heuer has a blog post entitled "StringFormat and CurrentCulture in Silverlight" about this for Silverlight so I expect the same problem occurs in WPF.
The solution for Silverlight is to add the following line to the view constructor:
this.Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name);
Now for WPF you might just need to make sure that the CurrentThread.CurrentCulture
is set correctly, if not try adding this line too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With