I'm having a bit of a problem with WPF property binding. First the code.

C#

```
public partial class WPFTextBox: UserControl
{
    private bool _bold;
    public bool Bold
    {
        get { return _bold; }
        set
        {
            _bold = value;
            OnPropertyChanged("Bold");
        }
    }

    private bool _selectionChanged;

    public WPFTextBox()
    {
        InitializeComponent();

        DataContext = this;

        Bold = true;  // <--- This works, the checkbox will be checked
        _selectionChanged = false;
     }

     private void txtDetails_SelectionChanged(object sender, RoutedEventArgs e)
     {
         var selection = txtDetails.Selection;
         _selectionChanged = true;
         Bold = selection.FontWeight() == FontWeights.Bold; 
         // ^-- This doesn't work It will trigger everything, but the checkbox won't
         // change value. FontWeight() is an extension I wrote
         _selectionChanged = false;
     }

     private void OnPropertyChanged(string name)
     {
         if(_selectionChanged)
            return; // If the change was brought from the user moving the
                    // cursor in the textbox, don't change the textbox.
         TextRange range = txtDetails.Selection;
         switch(name)
         {
             case "Bold":
                 // change selection to bold, like I mentioned I does work
                 break;
             default:
                 break;
         }
     }
}

```

XAML

```
<RichTextBox Name="txtDetails" SelectionChanged="txtDetails_SelectionChanged"/>

<CheckBox Name="chkBold" Content="Bold" IsChecked="{Binding Path=Bold}"/>

```

I'm creating a textbox with format options. The binding works in the constructor, but not in the selection changed event. I've tried adding a lot of options to the binding such as `Mode=TwoWay` and different property changed triggers.

The reason I'm using the `_selectionChanged` bool is because if I don't check for that, if I have a word was different formatting such as he**llo** and I click on it, it will change the formatting for all of the word to either bold or not. I think maybe it's because I'm handling it in selection changed event, but then I'm not sure where else I could change property value.