title: RichTextBox - Line breaks between TextRanges
body: <p>I'm having a small issue with the RichTextBox.</p>
  
  <p>I'm trying to do some sort of chat including different colors each line and that's why I use the RichTextBox instead of the normal one. But I am having some trouble with line breaks.</p>
  
  <p>My goal is to achieve this format:</p>
  
  <pre><code>Player 1: Hello world!
  System Bot: The game has begun!
  Player 2: sup man?
  Player 1: Nothing
  </code></pre>
  
  <p>Unfortunately my code somehow isn't doing its job so far:</p>
  
  <pre><code>public void Handle(NewMessageMessage message)
  {
      var messageStr = message.Message;
  
      var range = new TextRange(ChatMessages.ContentEnd, ChatMessages.ContentEnd);
  
      switch (message.Type)
      {
          case MessageType.SystemInformation:
              range.Text = string.Concat("System-Bot: ", messageStr, "\r\n");
              range.ApplyPropertyValue(TextElement.ForegroundProperty, new SolidColorBrush(Color.FromArgb(255, 255, 150, 0)));
              break;
          case MessageType.SystemWarning:
              range.Text = string.Concat("System-Bot: ", messageStr, "\r\n");
              range.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Red);
              break;
          case MessageType.PlayerMessage:
              range.Text = string.Concat(messageStr, "\r\n");
              range.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Blue);
              break;
      }
  
      NotifyOfPropertyChange(() =&gt; ChatMessages);
  
      TriggerScrollViewerScroll = true;
  }
  </code></pre>
  
  <p>The code is not giving me the result I expected:</p>
  
  <pre><code>Player 1: Hello world!System Bot: The game has begun!
  
  Player 2: sup man?
  
  Player 1: Nothing
  </code></pre>
  
  <p>Leaving out the \r\n gives me this:</p>
  
  <pre><code>Player 1: Hello world!System Bot: The game has begun!Player 2: sup man?Player 1: Nothing
  </code></pre>
  
  <p>My RichTextBox looks like this:</p>
  
  <pre><code>&lt;controls:ChatRichTextBox Document="{Binding ChatMessages}"  IsReadOnly="True" Margin="5"/&gt;
  </code></pre>
  
  <p>Someone knows what's going on there?</p>