How Can I Enumerate All The Descendants Of A Visual Object

How Can I Enumerate All The Descendants Of A Visual Object


  • 16 Dec, 2011

    You can enumerate all the descendants of a visual object as follows :[C#]// Enumerate all the descendants of the visual object.static public void EnumVisual(Visual myVisual){for (int i = 0; i < VisualTreeHelper.GetChildrenCount(myVisual); i++){// Retrieve child visual at specified index value.Visual childVisual = (Visual)VisualTreeHelper.GetChild(myVisual, i);// Do processing of the child visual object.// Enumerate children of the child visual object.EnumVisual(childVisual);}}

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.