我正在尝试这样做:
<TextBlock Text="{Binding Path=Text,
Converter={StaticResource stringFormatConverter},
ConverterParameter='\"{0}\"'}" />
但这显然不是在 XAML 绑定字符串中获取引号的方法。
让 "\"{0}"\" 在这里工作的适当方法是什么?
你有两个选择:
""{0}""
'"{0}"'
这在这里解释:http: //msdn.microsoft.com/en-us/library/ms748250.aspx
在你的例子中(我一开始看不到你想要做什么),你可能想要做:
...='"{0}"'
这里我在windows phone中绑定文本后添加“%”。
<TextBlock Text="{Binding Path=clouds.all, StringFormat=\{0\}%}"/>