开发者

How to use a literal curly brace "{" in XAML?

开发者 https://www.devze.com 2023-03-12 16:47 出处:网络
I need put in } and { in a XAML ConvertParameter without it being interpreted: ConverterParameter = \"{0}/{1}\"

I need put in } and { in a XAML ConvertParameter without it being interpreted:

ConverterParameter = "{0}/{1}"

...which does not work. 开发者_如何学GoHow to do this?


You can use:

ConverterParameter = "{}{0}/{1}"

More information can be found here.


Use {} as the escape sequence.

ConverterParameter = "{}{0}/{1}"


For those who got here looking for the answer for WinRT-XAML. The escape sequence is \ sign. Although this documentation states ' should work but on the other hand this example uses \ (which actually worked for me).

0

精彩评论

暂无评论...
验证码 换一张
取 消