title: Custom WPF Control Dependency Property Not Binding to external DP
body: <p>I'm trying real hard to make this short and easy to read.
  I am creating a custom control that has a DP defined (RandomNumber) in the code-behind. The value of this DP is set from a click event fired by a button in my control.</p>
  
  <p>Here is the relevant code for this:</p>
  
  <pre><code>public partial class Tester 
  {
      public int RandomNumber
      {
          get { return (int)GetValue(RandomNumberProperty); }
          set { SetValue(RandomNumberProperty, value); }
      }
  
      private Random rnd = new Random();
      private void Button_Click(object sender, RoutedEventArgs e)
      {
          RandomNumber = rnd.Next();
      }
  </code></pre>
  
  <p>The click event works and the value is set and I can confirm that it is changed. The problem that I am having is when I use this control in my application and I try bind "RandomNumber" to another DP on my View Model the binding never updates:</p>
  
  <pre><code> &lt;DockPanel&gt;
      &lt;TextBlock Text="{Binding Path=Numeric}" 
                 DockPanel.Dock="Top"
                 Height="25"/&gt;
      &lt;TestProject:Tester RandomNumber="{Binding Path=Numeric}" 
                               DockPanel.Dock="Top"
                               Height="25"
                               x:Name="TestControl"/&gt;
  
  &lt;/DockPanel&gt;
  </code></pre>
  
  <p>In the example above I have a view model with a DP named Numeric and I can confirm that this value is in fact never being updated by the binding.</p>
  
  <p>I can't figure out what I'm doing wrong.
  Thanks in advance for any help!</p>