title: UWP: DependencyProperty propertyChangedCallback not firing when set to null
body: <p>Title says it all...</p>
  
  <p>The code of my DependencyProperty is the following:</p>
  
  <pre><code>public object IsChecked
  {
      get { return GetValue(IsCheckedProperty); }
      set { SetValue(IsCheckedProperty, value); }
  }
  public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register("IsChecked", typeof(object),
                                                                typeof(MyCheckbox), 
                                                                new PropertyMetadata(false, IsCheckedChanged));
  
  private static void IsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  {
      var checkbox = d as MyCheckbox;
      bool? newvalue = null;
      if (e.NewValue is bool?)
          newvalue = (bool?)e.NewValue;
      else if (e.NewValue != null)
      {
          bool newbool;
          if (!bool.TryParse(e.NewValue.ToString(), out newbool))
              return;
          newvalue = newbool;
      }
      if (checkbox != null &amp;&amp; !checkbox.Checked.Equals(newvalue))
          checkbox.Checked = newvalue;
  }
  </code></pre>
  
  <p>I bind to that property like this:</p>
  
  <pre><code>&lt;local:MyCheckbox IsChecked="{Binding Stata,UpdateSourceTrigger=PropertyChanged}" /&gt;
  </code></pre>
  
  <p>Stata implemented like this:</p>
  
  <pre><code>private bool? _stata = null;
  public bool? Stata
  {
      get { return _stata; }
      set
      {
          _stata = value;
          OnPropertyChanged();
      }
  }
  </code></pre>
  
  <p>When Stata changes to "true", MyCheckbox updates as expected. However, when Stata starts as null or changes to null, MyCheckbox doesn't get the update, IsCheckedChanged doesn't fire.</p>
  
  <p>If I change the default value of my property to null like this:</p>
  
  <pre><code>public static readonly DependencyProperty IsCheckedProperty =
      DependencyProperty.Register("IsChecked",
          typeof(object),
          typeof(MyCheckbox),
          new PropertyMetadata(null, IsCheckedChanged));
  </code></pre>
  
  <p>It again works as expected, <code>IsCheckedChanged</code> is called whenever <code>Stata</code> changes to/from <code>true</code>/<code>false</code> and <code>null</code>.</p>
  
  <p>Is this a bug? I want my default value to be <code>false</code>, not <code>null</code>, how can I realize this?</p>
  
  <p><strong>Edit:</strong> I have uploaded a sample solution to GitHub, while the Changed functions get called now, the shown result is different for UWP when the value is <code>null</code><br>
  You can find the repository here: <a href="https://github.com/ManIkWeet/DependencyPropertyTest" rel="nofollow">https://github.com/ManIkWeet/DependencyPropertyTest</a></p>