UPDATE May 4, 2011: It was brought to my attention that there was a typo in my code below, but it is now fixed.
I sometimes find it necessary to walk the visual tree of controls in Silverlight (or WPF) at run-time. The VisualTreeHelper class provides some nice functionality for doing this. However, using the VisualTreeHelper can sometimes require a little too much code, especially when I want to search the visual tree recursively.
For this reason I created some simple extension methods to do the recursing for me. Let’s cut right to the chase. Here’s the code: