In XAML I have created CustomWindow. It contains many nested elements. Is exists simply method to get all named elements (I set names through x:Name="SomeName"), marked as public (I set modifier through x:FieldModifier="public")?
In XAML I have created CustomWindow . It contains many nested elements. Is exists
Share
There is no out of the box way I’m aware of. You have to browse the VisualTree using the
VisualTreeHelperand check if they have the properties you are interrested in.Here is a method that can do what you need :
Usage could be something like that for a check on the name only :