我正在尝试使用StringFormat在绑定到TextBlock的值周围插入撇号(apostrophe's?):
<TextBlock Text="{Binding MyValue, StringFormat='The value is '{0}''}"/>
然而,我遇到了编译错误:
在MarkupExtension中,名称和值不能包含引号。 MarkupExtension参数'MyValue,StringFormat =“The value is'{0}'”'无效。
我确实注意到对于引号,它可以正常工作:
<TextBlock Text="{Binding MyValue, StringFormat='The value is "{0}"'}"/>
这是StringFormat的一个错误吗?