<p>How can I add a line break to text when it is being set as an attribute i.e.:</p>

<pre><code>&lt;TextBlock Text="Stuff on line1 \n Stuff on line2" /&gt;
</code></pre>

<p>Breaking it out into the exploded format isn't an option for my particular situation.  What I need is some way to emulate the following:</p>

<pre><code>&lt;TextBlock&gt;
  &lt;TextBlock.Text&gt;
    Stuff on line1 &lt;LineBreak/&gt;
    Stuff on line2
  &lt;/TextBlock.Text&gt;
&lt;TextBlock/&gt;
</code></pre>

```
```
<TextBlock Text="Stuff on line1&#x0a;Stuff on line 2"/>
```
```
You can use any hexadecimally encoded value to represent a literal. In this case, I used the line feed (char 10). If you want to do "classic"
```
vbCrLf
```
, then you can use
```
&#x0d;&#x0a;
```
By the way, note the syntax: It's the ampersand, a pound, the letter
x
, then the hex value of the character you want, and then finally a semi-colon.
ALSO: For completeness, you can bind to a text that already has the line feeds embedded in it like a constant in your code behind, or a variable constructed at runtime.