Hi,
I'm wondering if there is a way to convert this so it would be more performant by using a Parallel.For for example.
public FrameworkElement FindIntersectingElement(Rect rectangle, UIElement activeElement)
{
foreach (var child in this.Children)
{
if (child != activeElement)
{
if (GetBounds(child as FrameworkElement, this).IntersectsWith(rectangle))
{
return child as FrameworkElement;
}
}
}
return null;
}
public Rect GetBounds(FrameworkElement of, FrameworkElement from)
{
GeneralTransform transform = null;
transform = of.TransformToVisual(from);
return transform.TransformBounds(new Rect(0, 0, of.ActualWidth, of.ActualHeight));
}
Any suggestions?