title: Ellipse Geometry Custom Shape
body: <p>I am deriving from shape to draw an ellipse. The drawing starts at 0,0 so only the bottom right corner of the ellipse its drawn. How do I transform the origin in the overridegeometry method:</p>
  
  <pre><code>class Ellipse2 : Shape
  {
      EllipseGeometry ellipse;
      public static readonly DependencyProperty TextBoxRProperty = DependencyProperty.Register("TextBoxR", typeof(TextBox), typeof(Ellipse2), new FrameworkPropertyMetadata(null));
      public TextBox TextBox
      {
          get { return (TextBox)GetValue(TextBoxRProperty); }
          set { SetValue(TextBoxRProperty, value); }
      }
      public Ellipse2()
      {
          ellipse = new EllipseGeometry();
  
          this.Stroke = Brushes.Gray;
          this.StrokeThickness = 3;
      }
      protected override Geometry DefiningGeometry
      {
          get
          {
              ellipse.RadiusX = this.Width/2;
              ellipse.RadiusY = this.Height/2;
  
              return ellipse;
          }
      }
  }
  </code></pre>