I don't believe there is a quick fix here, but you can do something using UIElement.InputHitTest(Point) .
You can make a call similar to
//get the coordinates of the top left corner of the child control within //the parent var childTopLeft = childControl.TranslatePoint(new Point(), parentControl); //check whether or not the child control is returned when you request the element //at that coordinate through hit testing var isVisible = (parentControl.InputHitTest(childTopLeft) == childControl);
However, I must point out that I have not tried this myself and that it probably will not work in the following scenarios:
- Transparent elements - as a rule, transparent backgrounds cause testing when testing a control for a parent
- Partially closed items - you can only check one point at a time, so if you see only part of your child control, you will need to check the correct point.
source share