title: DependencyProperty not update
body: <p>I have a user control with IsChecked Property</p>
  
  <pre><code>public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register(
          "IsChecked", typeof(bool), typeof(LabeledCheckbox),new FrameworkPropertyMetadata
      {
          DefaultValue = false,
          BindsTwoWayByDefault = true,
  
      });
  
      public bool IsChecked
      {
          get { return (bool)this.GetValue(IsCheckedProperty); }
          set { this.SetValue(IsCheckedProperty, value); }
      }
  </code></pre>
  
  <p>I'm bounding the IsChecked Property to a another property called active
  and i create a checkbox that the IsChecked Property also bound to the active property</p>
  
  <pre><code>&lt;controls:LabeledCheckbox x:Name="ccc" Tag="Active" CheckedColor=" #33cc00" UncheckedColor="#cc2900" CheckedContent="hello" UncheckedContent="world" IsChecked="{Binding Active, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" FontSize="25" Margin="5" Width="100"/&gt;
  &lt;CheckBox IsChecked="{Binding Active, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/&gt;
  </code></pre>
  
  <p>The checkbox is update correctly but the controls:LabeledCheckbox not update
  the other DP in controls:LabeledCheckbox  are working great.</p>
  
  <p>why the IsChecked property not updating?
  tried to use RelativeSource={RelativeSource AncestorType={x:Type Window}}
  on the controls:LabeledCheckbox like this:</p>
  
  <pre><code>&lt;controls:LabeledCheckbox x:Name="ccc" Tag="Active" CheckedColor=" #33cc00" UncheckedColor="#cc2900" CheckedContent="שלום" UncheckedContent="עולם" IsChecked="{Binding Active, RelativeSource={RelativeSource AncestorType={x:Type Window}}, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" FontSize="25" Margin="5" Width="100"/&gt;
  </code></pre>
  
  <p>tried one way to source</p>
  
  <p>the set of IsChecked never triggered unless i set True ao false directly and not binding.</p>
  
  <p><strong>UPDATE</strong>
  Adding the UserControl's full code:</p>
  
  <pre><code>public partial class LabeledCheckbox : UserControl
  {
      public LabeledCheckbox()
      {
          InitializeComponent();            
      }
  
      public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register(
          "IsChecked", typeof(bool), typeof(LabeledCheckbox),new FrameworkPropertyMetadata
      {
          DefaultValue = false,
          BindsTwoWayByDefault = true,
          PropertyChangedCallback = CheckChanged
  
      });
  
      private static void CheckChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
      {
          MessageBox.Show("Change");
      }
  
      public bool IsChecked
      {
          get { return (bool)this.GetValue(IsCheckedProperty); }
          set { this.SetValue(IsCheckedProperty, value); }
      }
  
      public static readonly DependencyProperty CheckedColorProperty = DependencyProperty.Register(
          "CheckedColor", typeof(Color), typeof(LabeledCheckbox), new PropertyMetadata(Colors.White));
  
      public Color CheckedColor
      {
          get { return (Color)this.GetValue(CheckedColorProperty); }
          set { this.SetValue(CheckedColorProperty, value); }
      }
  
      public static readonly DependencyProperty CheckedContentProperty = DependencyProperty.Register(
          "CheckedContent", typeof(string), typeof(LabeledCheckbox), null);
  
      public string CheckedContent
      {
          get { return (string)this.GetValue(CheckedContentProperty); }
          set { this.SetValue(CheckedContentProperty, value); }
      }
  
      public static readonly DependencyProperty UncheckedColorProperty = DependencyProperty.Register(
          "UncheckedColor", typeof(Color), typeof(LabeledCheckbox), new PropertyMetadata(Colors.White));
  
      public Color UncheckedColor
      {
          get { return (Color)this.GetValue(UncheckedColorProperty); }
          set { this.SetValue(UncheckedColorProperty, value); }
      }
      public static readonly DependencyProperty UncheckedContentProperty = DependencyProperty.Register(
          "UncheckedContent", typeof(string), typeof(LabeledCheckbox), null);
  
      public string UncheckedContent
      {
          get { return (string)this.GetValue(UncheckedContentProperty); }
          set { this.SetValue(UncheckedContentProperty, value); }
      }
  
  
      public static readonly RoutedEvent CheckedChangeEvent = EventManager.RegisterRoutedEvent("CheckedChange", RoutingStrategy.Direct, typeof(RoutedEventHandler), typeof(LabeledCheckbox));
  
      public event RoutedEventHandler CheckedChange
      {
          add { AddHandler(CheckedChangeEvent, value); }
          remove { RemoveHandler(CheckedChangeEvent, value); }
      }
  
      private void ToggleCheckbox(object sender, MouseButtonEventArgs e)
      {
          IsChecked = !IsChecked;
          AnimateCheckbox();
          RaiseCheckedChangeEvent();
      }
  
      private void AnimateCheckbox()
      {
          DoubleAnimation cAnim = null;
          DoubleAnimation ucAnim = null;
          if (IsChecked)
          {
              cAnim = AnimationsHandler.AnimateElementWidth(0, this.Width, TimeSpan.FromMilliseconds(400));
              ucAnim = AnimationsHandler.AnimateElementWidth(this.Width, 0, TimeSpan.FromMilliseconds(400));
          }
          else
          {
              cAnim = AnimationsHandler.AnimateElementWidth(this.Width, 0, TimeSpan.FromMilliseconds(400));
              ucAnim = AnimationsHandler.AnimateElementWidth(0, this.Width, TimeSpan.FromMilliseconds(400));
          }
          var sb = new Storyboard();
          AnimationsHandler.AddToStoryboard(sb, cAnim, check, new PropertyPath(FrameworkElement.WidthProperty));
          AnimationsHandler.AddToStoryboard(sb, ucAnim, uncheck, new PropertyPath(FrameworkElement.WidthProperty));
          sb.Begin();
      }
  
      void RaiseCheckedChangeEvent()
      {
          RoutedEventArgs newEventArgs = new RoutedEventArgs(LabeledCheckbox.CheckedChangeEvent);
          RaiseEvent(newEventArgs);
      }
  
      private void UserControl_Loaded(object sender, RoutedEventArgs e)
      {
          ToggleCheckbox(null, null);
      }
  }
  </code></pre>