title: TextBlock TextWrapping Wrap and NoWrap combined and Text through DynamicResource
body: <p>I have got multiple TextBlocks whose Text is inserted through DynamicResource. They are all set to TextWrapping="Wrap". But inside those Text-strings I have words which are not allowed to be split up. Those words must be kept as a whole word.</p>
  
  <p>With hardcoded Text in Xaml it's quite easy solved via a TextBlock inside a Textblock:</p>
  
  <pre><code>&lt;TextBlock TextWrapping="Wrap"&gt;
  Example text with wrap and &lt;TextBlock TextWrapping="NoWrap" Text=" example text without wrap"/
  &lt;/TextBlock&gt;
  </code></pre>
  
  <p>But this solution does not work when Text the is inserted through DynamicResource, because the text is not getting parsed.</p>
  
  <p>How can I combine nowrap and wrap inside a DynamicResource Text without splitting it into multiple TextBlocks one after another?</p>
  
  <p>PS: I have now created an <strong>example to demonstrate the behavior</strong> I would like (<strong>green</strong>) and the <strong>failed attempts (red, orange, darkred)</strong> of solving it:</p>
  
  <pre><code>&lt;StackPanel HorizontalAlignment="Center" Width="80" Orientation="Vertical"&gt;
              &lt;TextBlock TextWrapping="Wrap" Foreground="green"&gt;
                  bla1 bla2 bla3 bla4 &lt;TextBlock TextWrapping="NoWrap" Text="Together(en)"/&gt; bla5 bla6 longWordWhichShouldBreak
              &lt;/TextBlock&gt;
              &lt;TextBlock TextWrapping="Wrap" Foreground="red"&gt;
                  bla1 bla2 bla3 bla4 Together(en) bla5 bla6 longWordWhichShouldBreak
              &lt;/TextBlock&gt;
              &lt;TextBlock TextWrapping="Wrap" Foreground="orange"&gt;
                  bla1 bla2 bla3 bla4&amp;#160;Together(en)&amp;#160;bla5 bla6 longWordWhichShouldBreak
              &lt;/TextBlock&gt;
              &lt;TextBlock TextWrapping="WrapWithOverflow" Foreground="DarkRed"&gt;
                  bla1 bla2 bla3 bla4&amp;#160;Together(en)&amp;#160;bla5 bla6 longWordWhichShouldBreak
              &lt;/TextBlock&gt;
          &lt;/StackPanel&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ndSFX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ndSFX.png" alt="Result"></a></p>