title: Custom RichTextBox and Text Property Binding
body: <p>I have created a custom <code>RichTextBox</code> control and exposed a <code>Text</code> property. The <code>Text</code> property is defined as follows: </p>
  
  <pre><code>public string Text
  {
      get
      {
          return new TextRange(Document.ContentStart, Document.ContentEnd).Text; 
      }
      set
      {
          AppendText(value); 
          OnPropertyChanged("Text");
      }
  }
  </code></pre>
  
  <p>The <code>RichTextBox</code> is using a <code>ViewModel</code> as <code>DataContext</code> as shown below: </p>
  
  <pre><code>&lt;WPF:SharpRichTextBox MaxCharactersAllowed="100" NotificationStyleName="defaultTextBlockStyle"
                        Text="{Binding Path=Name, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
                        DefaultNotificationStyleName="textblockStyle" Margin="10,10,10,10"
                        Background="Yellow"&gt;
  &lt;/WPF:SharpRichTextBox&gt;
  </code></pre>
  
  <p>Now I want that whenever I change the <code>Text</code> of the <code>RichTextBox</code> the <code>Name</code> property in the <code>ViewModel</code> gets updated. How can I do that? </p>