/// <summary>
/// Returns a value indicating whether a point is inside the bounding box of the element.
/// </summary>
/// <param name="element"></param>
/// <param name="pointRelativeToElement"></param>
/// <returns></returns>
public static bool ContainsPoint(this FrameworkElement element, Point pointRelativeToElement)
{
//TODO: Silverlight allows more complex geometries than Rectangle.
Rect rect = new Rect { X = 0, Y = 0, Width = element.ActualWidth, Height=element.ActualHeight };
return rect.Contains(pointRelativeToElement);
}