Here's the background for my question:
System.Windows.Documents.AdornerLayer
is empty or not.myAdornerLayer.VisualChildrenCount > 0
."AdornerLayer.VisualChildrenCount
is protected." (It overrides System.Windows.FrameworkElement.VisualChildrenCount
which is also protected.)myAdornerLayer.VisualChildrenCount
via reflection."VisualChildrenCount
has been protected for a reason. I'll ask Stack Overflow".If using reflection is a bad idea, do you have a suggestion for another way of finding out if an AdornerLayer
is empty or not?
There is Visual Tree Helper
class, that was made for this purpose..