xaml - How to represent Line Break or new line in silverlight textBox -


i having hard time match special characters set in silverlight. on following:

to represent linebreak in silverlight textblock:

use : > linebreak <

but use represent new line or linebreak in silverlight textbox??

example : want 1 line mag : line one. line 2

into :

this line one. line two.

it seems \r\n not working. line 1 \r\n

the bottom line @ top

<textbox text="this line one!&#13;this line two!" /> 

linebreak weirdness in silverlight textbox

if going initialising content of textbox literal text in xaml in similiar way might textblock need reliable way represent line break character silverlight uses in xaml.

silveright uses cr character (0x0d - ascii 13) represent linebreak in c# include in string literal \r. xaml isn't c# can't use \r in xaml.

xaml fundementally xml xaml parsing oddities. including linebreak, derek has in answer, directly in xaml not work @ runtime (although designer displays expected). might think because xml uses lf character (0x0a) linebreak character. in code can assign string containing "\r" or "\n" text property , textbox show new line. in fact can assign sequence "\r\n" , show single new line (not 2 new lines).

ultimately can use xml character code entity represent \r in xaml "&#13;" survives xaml parsing process reason cannot explain.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -