Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF StringFormat={}{0:N} Error "Expected '"

I'm getting an error in VS 2008 SP1 with WPF using the stringformat binding, is there an inherent problem with wpf in vs 2008?

Error 1 Expected ' ConstituentCrossrateGridControl.xaml 70 141 PriceViewWpfLibrary

like image 671
bkmtan Avatar asked Oct 29 '25 14:10

bkmtan


2 Answers

As the error message suggests, try wrapping your StringFormat value in single quotes. For example:

<TextBlock Text="{Binding StringFormat='{}{0:N}'}" />
like image 179
Matt Hamilton Avatar answered Nov 01 '25 08:11

Matt Hamilton


Visual Studio 2008 IDE's XAML syntax parser has several bugs where it complains that certain valid XAML is invalid.

Does this method of escaping work for you?

StringFormat=\{0:N\}
like image 28
Ben Gribaudo Avatar answered Nov 01 '25 08:11

Ben Gribaudo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!