I can do this ...">

How to use the symbol "{" in the xaml string

How to use the symbol {in the xaml string? For instance:.

<TextBlock Text="{0}"/> 

I can do this starting with a space character:

 <TextBlock Text=" {0}"/> 

but I'm looking for a better solution.

+4
source share
1 answer

Like this:

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

{} at the beginning tells the parser not to search for markup extensions.

Alternatively, you can specify data without using the attribute:

 <TextBlock>{0}</TextBlock> 
+8
source

Source: https://habr.com/ru/post/1315425/


All Articles