title: Button control template with resizable circle
body: <p>I am learning about control templates in WPF and checking out how to replace the button look with custom template styles. I see that to make a circle button, a Ellipse has to be defined with the same height and width.</p>
  
  <pre><code>&lt;Style x:Key="Button2" TargetType="Button"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="Button"&gt;
                  &lt;Grid&gt;
                      &lt;Ellipse Fill="LightGreen" Width="80" Height="80"/&gt;
                      &lt;ContentPresenter HorizontalAlignment="Center"
  VerticalAlignment="Center"/&gt;
                  &lt;/Grid&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
      &lt;Setter Property="Control.Margin" Value="10"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Of course, that only forces all buttons using that style to have a circle with a diameter of 80 pixels, regardless of how the button is resized. I'd like for the circle to take on the shorter of the height/width values, so that it can <em>dynamically scale</em> according to the button sizing.</p>
  
  <p>However i have not read any material that teaches how this can be done in pure XAML template? It seems that some code-behind is required to achieve this effect?</p>