c# - How to print new lines TextBlock in Windows Phone 8.1 app -


i'm new xaml , cannot seem understand how write code textblock can keep adding new lines of text rest of code runs. want write simple app windows phone simple task , every time hits response or error, prints textblock in ui rather log or debug.writeline or console.writeline. please me or @ least tell me can learn how myself? i've searched in vain can seen.

i've tried textblock.text += string , doesn't seem update @ all.

using uncode

        <textblock text="newline1 &#x0a; newline2 &#x0a; newline3"></textblock> 

using linebreak

        <textblock margin="0,20,0,0">line1<linebreak></linebreak>line2<linebreak></linebreak>line3</textblock> 

using textwrap property link

 <textblock margin="0,20,0,0" textwrapping="wrap" >         lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.     </textblock> 

final xaml code

  <stackpanel background="{themeresource applicationpagebackgroundthemebrush}">     <!--using uncode &#x0a; -->     <textblock text="newline1 &#x0a; newline2 &#x0a; newline3"></textblock>      <!--using linebreak tag -->     <textblock margin="0,20,0,0">line1<linebreak></linebreak>line2<linebreak></linebreak>line3</textblock>     <!--using textwrap property  -->      <textblock margin="0,20,0,0" textwrapping="wrap" >         lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.     </textblock> </stackpanel> 

output

enter image description here

using c#

in c#, what's difference between \n , \r\n?


Comments