xaml - Newline in string attribute -


how can add line break text when being set attribute i.e.:

<textblock text="stuff on line1 \n stuff on line2" /> 

breaking out exploded format isn't option particular situation. need way emulate following:

<textblock>   <textblock.text>     stuff on line1 <linebreak/>     stuff on line2   </textblock.text> <textblock/> 

<textblock text="stuff on line1&#x0a;stuff on line 2"/> 

you can use hexadecimally encoded value represent literal. in case, used line feed (char 10). if want "classic" vbcrlf, can use &#x0d;&#x0a;

by way, note syntax: it's ampersand, pound, letter x, hex value of character want, , semi-colon.

also: completeness, can bind text has line feeds embedded in constant in code behind, or variable constructed @ runtime.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -