private bool IsRectInRect(Rect rect1, Rect rect2)
 {
     if (rect1.Contains (rect2.BottomRight ()) || rect1.Contains (rect2.BottomLeft ()) || rect1.Contains (rect2.TopLeft ()) || rect1.Contains (rect2.TopRight ()))
     {
         return true;
     }
     return false;
 }