Here is the solution I finally used. For each element I want to check if it intersects with others, I create a Rect containing it. That way I can use the IntersectsWith method.
Example (with rectangles, but you can do it with other numbers, UserControls, ...): XAML
<Canvas> <Rectangle x:Name="Rectangle1" Height="100" Width="100"/> <Rectangle x:Name="Rectangle2" Height="100" Width="100" Canvas.Left="50"/> </Canvas>
WITH#
Rect rect1 = new Rect(Canvas.GetLeft(Rectangle1), Canvas.GetTop(Rectangle1), Rectangle1.Width, Rectangle1.Height); Rect rect2 = new Rect(Canvas.GetLeft(Rectangle2), Canvas.GetTop(Rectangle2), Rectangle2.Width, Rectangle2.Height); if(rect1.IntersectsWith(r2)) {
source share