C# clear all textboxes and uncheck all checkboxes in WPF
<p>I am trying to figure out how to clear all textboxes and uncheck all checkboxes in a C# WPF. The form has a lot of textboxes and it will get tedious to do .Clear() or = "" for every single textbox. Same thing with checkboxes.</p>

<p>I heard it is easy in Windows Forms doing something like below using a foreach loop, but I am doing this on a WPF so I cant get that to work.</p>

<pre><code>foreach (Control c in Controls)
{
  if (c is CheckBox)
  {
     ((CheckBox) c).Checked = false;
  }
  else if (c is TextBox)
  {
    ((TextBox) c).Text = "";
  }
}
</code></pre>

<p>Anyone have any advice? Thanks</p>