David Bekham
David Bekham

Reputation: 2175

How to put & symbol in the Text property of TextBlock in xaml?

I need to the display the Text which is having the & symbol in the TextBlock... Is there any way to display in xaml... Even i write the Text with the & symbol in the Text property of TextBlock.. It displays an error ?

Upvotes: 1

Views: 3410

Answers (2)

V4Vendetta
V4Vendetta

Reputation: 38220

Well you should try using & which should show up as &

and maybe you can also achieve the same using CDATA <![CDATA[&]]>

Special Characters in XAML

Upvotes: 8

Rajesh Subramanian
Rajesh Subramanian

Reputation: 6490

It must be an encoding issue with xaml, yoou could use html encoded string to print some special characters there.

for ampersand, you coudld use &amp;. Hope this helps.

Upvotes: 1

Related Questions