开发者

How to use "{" symbol in xaml string

开发者 https://www.devze.com 2023-01-07 07:53 出处:网络
How can I use { symbol in xaml string? E.g.: <TextBlock Text=\"{0}\"/> I can do it starting string with a space symbol:

How can I use { symbol in xaml string? E.g.:

<TextBlock Text="{0}"/>

I can do it starting string with a space symbol:

<TextBlock Text=" {0}"/>
开发者_C百科

but I'm looking for a better solution.


Like this:

<TextBlock Text="{}{0}"/>

The {} at the start tells the parser to not look for markup extensions.

Alternatively, you can specify the data without using an attribute:

<TextBlock>{0}</TextBlock>
0

精彩评论

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