private static Rect GetIntersectionArea( ISpatialBinding binding, IDictionary<IWindowElement, Rect> setToChallenge, Rect rect, ref Rect enlargedRectangle, out IWindowElement otherWindow )
{
ICollection<IWindowElement> boundWindows = binding.AllDescendants().Select( x => x.Window ).ToArray();
otherWindow = null;
Rect rectWindow = setToChallenge[binding.Window];
foreach( var item in setToChallenge )
{
otherWindow = item.Key;
// If in all registered windows a window intersect with the one that moved
if( otherWindow != binding.Window && !boundWindows.Contains( otherWindow ) )
{
rect = setToChallenge[otherWindow];
if( !rectWindow.IntersectsWith( rect ) && rect.IntersectsWith( enlargedRectangle ) ) return Rect.Intersect( enlargedRectangle, rect );
}
}
return Rect.Empty;
}