title: WPF RichTextBox-Foreground color from current caret position when selection is empty
body: <p>I have RichTextBox and Button,when a text is selected in RichTextBox method Button_Click changes the text foreground color, but when selected text is empty, foreground color doesn't change when I add  a new text in RichTextBox. The foreground color is still the same.</p>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;StackPanel Margin="10"&gt;
          &lt;Button Height="50" Content="Set Color" Click="Button_Click"/&gt;
          &lt;RichTextBox x:Name="richTextBox" Height="198" /&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p><strong>Code-Behind</strong></p>
  
  <pre><code>private void Button_Click(object sender, RoutedEventArgs e)
  {
  
          if (!richTextBox.Selection.IsEmpty)
          {
              //selection isn't empty foreground changed
              richTextBox.Selection.ApplyPropertyValue(RichTextBox.ForegroundProperty, RandomColor());
          }
          else
          {
              //here code when selection text in richtextbox is empty????
          }
          richTextBox.Focus();
   }
  
  private Brush RandomColor()
  {
          Brush[] brushes = new Brush[]{
              Brushes.Red,Brushes.Pink,Brushes.Blue,Brushes.Green,Brushes.Yellow
          };
          Random rnd = new Random();
          return brushes[rnd.Next(brushes.Length)];
  
   }
  </code></pre>