title: How do I Bind a WPF Ellipse's Height to its own Width?
body: <p>I have an ellipse drawn inside a Grid.Row and Grid.Column.  The Row is always taller than the Column is wide.</p>
  
  <p>I want to draw an ellipse that fills the width of the grid column and who's height makes it a perfect circle.</p>
  
  <p>I also want to draw a single digit number exactly in the center of the above ellipse.  Basically ending up with a circle that has a number centered inside it.</p>
  
  <p>I can easily set HorizontalAlignment="Stretch" on my Ellipse and on the TextBlock containing the number.  This takes care of the width for me.  However, how do I get the Height of the Ellipse and TextBlock to always match its Width, even when the Grid.Column width changes?</p>
  
  <p>Here's some XAML to illustrate this.  In the XAML below, I want the hard coded '63' to be based on the Grid.Column width, or the Width feild of the ellipse:</p>
  
  <pre><code>    &lt;Ellipse Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" Height="63" Stroke="Black" StrokeThickness="3" VerticalAlignment="Top"/&gt;
      &lt;TextBlock Grid.Row="1" Grid.Column="0" Width="63" Height="63" VerticalAlignment="Top" Text="1" TextAlignment="Center" FontSize="42" FontWeight="Bold"/&gt;
  </code></pre>
  
  <p>Thanks for all your help.  I ended up using Herdo's answer.  Just set HorizontalAlignment to Stretch and then bind the height to the actual width of the ellipse.  I did this same thing to the ellipse and to the text block:</p>
  
  <pre><code>    &lt;Ellipse HorizontalAlignment="Stretch" Height="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"/&gt;
      &lt;TextBlock HorizontalAlignment="Stretch" Height="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"/&gt;
  </code></pre>