public override OverlayElement FindElementAt( float x, float y )
{
OverlayElement ret = null;
int currZ = -1;
if ( isVisible )
{
ret = base.FindElementAt( x, y ); //default to the current container if no others are found
if ( ret != null && childrenProcessEvents )
{
foreach ( OverlayElement currentOverlayElement in children.Values )
{
if ( currentOverlayElement.IsVisible && currentOverlayElement.Enabled )
{
int z = currentOverlayElement.ZOrder;
if ( z > currZ )
{
OverlayElement elementFound = currentOverlayElement.FindElementAt( x, y );
if ( elementFound != null )
{
currZ = z;
ret = elementFound;
}
}
}
}
}
}
return ret;
}
#endregion