Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Quotation Marks in StringFormat of Binding in WPF

Tags:

I'm trying to wrap a TextBlock's Text property (which is a string that is pulled from the database) in quotes without using a converter; I'd never tried the Binding's StringFormat property before today, and I seem to be doing something wrong.

Here is the code that isn't working:

<TextBlock Text="{Binding QuoteText, StringFormat='\"{0}\"'}" />

Any ideas?

like image 274
egoodberry Avatar asked Nov 11 '09 19:11

egoodberry


1 Answers

This is XML, so &quot; is your friend.

like image 80
Kent Boogaart Avatar answered Sep 30 '22 23:09

Kent Boogaart