IEnumarable<DependencyObject> AllDescendent(DependencyObject current)
{
yield return current;
int n = VisualTreeHelper.GetChildrenCount();
for (int k = 0; k < n; k ++)
{
DependencyObject child = VisualTreeHelper.GetChild(current, k);
foreach(var descendent in AllDesendent(child))
{
yield return descendent;
}
}
}
Тогда
var textboxes = AllDescendent(layoutRoot).OfType<TextBox>();