title: Wpf RichTextBox wrapping problems
body: <p>I am having a problems with text wrapping in <code>WPF</code>'s <code>RichTextBox</code>, when I get the text like:</p>
  
  <pre><code>  TextRange tr = new TextRange(rtb.Document.ContentStart,
                                 rtb.Document.ContentEnd);
  </code></pre>
  
  <p><code>tr.Text</code> doesnt have any "\r\n", but in visual control it looks like it should be (it wraps when input reaches <code>RichTextBox</code> border (inserts end of the line)).</p>
  
  <p>I create RichTextBox like this:</p>
  
  <pre><code> &lt;RichTextBox Name="Rtb"  AcceptsReturn="True" AcceptsTab="True"   VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  
      HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Height="100" Margin="15,125,5,45"  Width="272"&gt;
              &lt;FlowDocument  LineHeight="1" IsColumnWidthFlexible="true" &gt;
                  &lt;Paragraph LineStackingStrategy="MaxHeight"&gt;
                      &lt;Run Text="RichTextBox"/&gt;
                  &lt;/Paragraph&gt;
              &lt;/FlowDocument&gt;
   &lt;/RichTextBox&gt;
  </code></pre>