title: WPF mutliselection of shapes using drag rectangle
body: <p>I would like to implement multiple selection of shapes using a drag rectangle.
  I've many shapes on a canvas like that :
  <img src="https://i.stack.imgur.com/zRBVX.png" alt="enter image description here"></p>
  
  <p>Thoses shapes are bound to corresponding models (MVVM).
  My selection rectangle looks like that :
  <img src="https://i.stack.imgur.com/JSWPf.png" alt="enter image description here"></p>
  
  <p>When I finished drawing the selection rectangle (mouse up event), I run this code :</p>
  
  <pre><code>var itemToSelect = ViewModel.ItemsInCanvas.Where((item) =&gt;
  {
      // TODO : test each types of shapes to know if the selection rectangle intersects with it
  }).ToList();
  </code></pre>
  
  <p>I have differents kinds of object model for the shapes:</p>
  
  <ul>
  <li>The quadrilateral : I can get (in code) the coordinates of each of
  the four points.</li>
  <li>The triangle : I can get (in code) the coordinates of each of the
  three points.</li>
  <li>The curve : I can get the path data (as string).</li>
  <li>The ligne : I can get the two points (the sinusoidal is the same
  object)</li>
  <li>The circle : I can get the height and the width.</li>
  </ul>
  
  <p>I can also get the top and the left of each shape.</p>
  
  <p>All thoses shapes are stored on a list in my main view model: ItemsInCanvas</p>
  
  <p>When I enter the code above, I would like to test each element to know if they intersects with the selection rectangle (whose I know the coordinates).</p>
  
  <p>My first try was (only for the curve item):</p>
  
  <pre><code>var itemToSelect = ViewModel.ItemsInCanvas.Where((item) =&gt;
  {
      if (item is CurveItem)
      {
          // I got my Curve Item
          CurveItem curveItem = (item as CurveItem);
          // I got the selection rectangle
          RectangleGeometry SelectionRectangleGeometry = new RectangleGeometry(SelectionRectangle);
          // Is the rectangle intersecting the shape ?
          if (SelectionRectangleGeometry.FillContainsWithDetail(Geometry.Parse(curveItem.Data)) == IntersectionDetail.Intersects)
              return true;
      }
  }).ToList();
  </code></pre>
  
  <p>But it doesnt work, the test returns allway the same thing : Intersects.</p>
  
  <p>I think the test doesn't take care of the position of each shapes (like if it was in absolute, not in relative).</p>
  
  <p>Do you know how I can do my tests ?</p>