title: How to add a rectangle to PathFigure WPF
body: <p>I was totally tired of adding a <code>Rectangle</code> to a path figure. Below was my tried code, but it does not results correctly as a <code>Rectangle</code>:</p>
  
  <pre><code>PathGeometry geom = new PathGeometry();
  Geometry g = new RectangleGeometry(myrectangel);
  geom.AddGeometry(g);
  
  PathFigureCollection collection = geom.Figures;
  pathfigure = collection[0];
  </code></pre>
  
  <p>Is there any other way?</p>