title: WPF Custom Button's Command Binding doesn't work
body: <p>I created a custom button that inherits the Button class. I added some dependency property that I need to let the user specify how the button will look like.</p>
  
  <p>The button looks great and the dependency property also worked as I wished. But however, the Command property doesn't work no matter how I try.</p>
  
  <p>Here's my sample:</p>
  
  <pre><code>public partial class CustomButton : Button
  {
      ... //some dependency property
      public CustomButton()
      {
         ...//do some initialization
         //I tried checking the Command property over here but it seems like always to be NULL?!
      }
  }
  </code></pre>
  
  <p>My XAML:</p>
  
  <pre><code>&lt;Button x:Class="CustomButton"
          xmlns:.....&gt;
     &lt;Button.Resources&gt;
     &lt;Style TargetType="Button" x:Key="CustomButtonStyle"&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate  TargetType="{x:Type Button}"&gt;
                      &lt;StackPanel Orientation="Horizontal" Background="Transparent" Height="22"&gt;
                      ......more things behind...
     &lt;/Style&gt;
     &lt;/Button.Resources&gt;
     &lt;Button.Style&gt;
     &lt;Style TargetType="{x:Type Button}" BasedOn="{StaticResource CustomButtonStyle}"&gt;
     &lt;/Style&gt;
     &lt;/Button.Style&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>I used it in my other windows control like this:</p>
  
  <pre><code> &lt;Controls:CustomButton Command="{Binding NewCommand}" ToolTip="AddNew"/&gt;
  </code></pre>
  
  <p>The command always not being executed, why? Did I miss out anything? 
  Please help. Thanks.</p>