title: Register dependency property on button
body: <p>I created a new class : ButtonLogin that extends Button class. I attached a new property called Immage. I created a style for it, but I have this error: <strong>Error    11  Cannot find the static member 'ImmageProperty' on the type 'ButtonLogin'</strong></p>
  
  <pre><code>class ButtonLogin: Button
  {
      public static readonly DependencyProperty ImageProperty = DependencyProperty.RegisterAttached("Immage", typeof(ImageSource), typeof(ButtonLogin), new FrameworkPropertyMetadata((ImageSource)null));
  
  
      public ImageSource Immage
      {
          get
          {
              return (ImageSource)GetValue(ImageProperty);
          }
          set
          {
              SetValue(ImageProperty, value);
          }
      }
  </code></pre>
  
  <p>Xaml:</p>
  
  <pre><code>&lt;Style x:Key="ButtonLogin" TargetType="{x:Type local:ButtonLogin}"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type local:ButtonLogin}"&gt;
                  &lt;Grid&gt;
                      &lt;Ellipse&gt;
                          &lt;Ellipse.Fill&gt;
                             &lt;ImageBrush ImageSource="/LogIq;component/Images/circ.fw.png"/&gt;
                    &lt;/Ellipse.Fill&gt;
                      &lt;/Ellipse&gt;
                      &lt;Image Margin="21,17,19,18" Source="{TemplateBinding Immage}" Stretch="Uniform"/&gt;
                  &lt;/Grid&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsFocused" Value="True"/&gt;
                      &lt;Trigger Property="IsDefaulted" Value="True"/&gt;
                      &lt;Trigger Property="IsMouseOver" Value="True"/&gt;
                      &lt;Trigger Property="IsPressed" Value="True"/&gt;
                      &lt;Trigger Property="IsEnabled" Value="False"/&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>I guess the problem is here: Source="{TemplateBinding Immage} , but I don't understand why, because I made another button the same way. </p>