如何使用引用” XAML 绑定中的字符?
我正在尝试这样做:
<TextBlock Text="{Binding Path=Text,
Converter={StaticResource stringFormatConverter},
ConverterParameter='\"{0}\"'}" />
但这显然不是将引号放入 XAML 绑定字符串的方法。
让“\”{0}“\”在这里工作的适当方法是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您有两个选择:
此处对此进行了解释:http://msdn.microsoft.com /en-us/library/ms748250.aspx
在您的示例中(我一开始看不到您想要做什么),您可能想要执行以下操作:
You have two options:
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:
这里我在Windows Phone中绑定文本后添加“%”。
Here I add "%" after binding text in windows phone.