I'm programming in c#(WPF). I have a lot of nested controls. I want to clear all of my TextBox control which are in my application. It is very hard to access them by their name. Is there any way to access them recursively and clear them?
for example some thing like this:
public void ClearAll(Control c)
{
if(c is TextBox)
{
((TextBox)c).Clear();
return;
}
foreach(Control child in GetChild(c))
{
ClearAll(child);
}
}