【转】在 XAML 的属性中,转义大括号 {}

我们知道大括号“{}”在XAML中是用来处理标记扩展的。

比如:

<Button Content="{Binding}"/>

 

但如何转义而表示普通大括号的字符串呢?

比如:

<Button Content="{these are braces}, {Others}"/>

这样写会编译失败:值不是有效的 MarkupExtension 表达式。

 

正确的写法是:

<Button Content="{}{these are braces}, {Others}"/>

 

来源:http://www.cnblogs.com/zhouyinhui/archive/2009/07/16/1524717.html

posted @ 2016-03-30 11:01  不是豆豆  阅读(420)  评论(0)    收藏  举报
友情链接:迷途