Intersect Method
Collapse the table of content
Expand the table of content

Rect.Intersect Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Finds the intersection of the rectangle represented by the current Rect and the rectangle represented by the specified Rect, and stores the result as the current Rect.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public void Intersect(
	Rect rect


Type: System.Windows.Rect
The rectangle to intersect with the current rectangle.

If no intersection exists, the current Rect becomes Rect.Empty.

Because this method alters the current Rect it acts upon even if there is no intersect, it is often a best practice to retain a copy before calling Intersect in case the intersect is empty or otherwise not a desirable value.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft