I'm trying to do this:
<TextBlock Text="{Binding Path=Text,
Converter={StaticResource stringFormatConverter},
ConverterParameter='\"{0}\"'}" />
But this is apparently not the way to get a quote into a XAML binding string.
What is the appropriate way to get "\"{0}"\" to work here?
{} Escape sequence / markup extensionProvides the XAML escape sequence for attribute values. The escape sequence allows the subsequent values in the attribute to be interpreted as a literal.
To pass an argument whose first character is @ , surround that argument with single or double quotes, otherwise it will be taken as a name of a response file which holds the actual command line.
Syntax Rules for Object Element It is because in XML, the value of the attributes must be a string, while in XAML, it can be a different object which is known as Property element syntax. The syntax of an Object element starts with a left angle bracket (<) followed by the name of the object, e.g. Button.
You have two options:
""{0}""
'"{0}"'
This is explained here: http://msdn.microsoft.com/en-us/library/ms748250.aspx
In your example (I couldn't see what you were trying to do at first), you'll probably want to do:
...='"{0}"'
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