silverlight - Ampersand in XAML -


when set text property of rolestextname codebehind in silverlight5 app doing:

rolestextname.text = "david &amp; goliath";   <textblock textwrapping="wrap">         <span fontweight="bold">roles:</span>         <span><run x:name="rolestextname" /></span> </textblock> 

problem: don't & symbol, actual text.

xaml used create object graph represents user interface. when modify user interface setting property values in code xaml has been processed , no longer used. should not xaml specific encoding when modifying object graph code. encoding required in xaml because based on xml , need way represents characters &, < , > unambgiously.

so executing

rolestextname.text = "david &amp; goliath"; 

will set text of run to

 david &amp; goliath 

to achieve want execute code insted:

rolestextname.text = "david & goliath"; 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -