TC Power

TC Power

  • NA
  • 6
  • 0

Hiding Controls During RunTime

Oct 23 2008 4:48 PM
I have an xbap application and I would like to hide controls on the page during runtime depending on whether the control is flaged as hidden in an Application hidden field table. Can someone tell me the equivance of reading controls on a page. Below is sample code that I used to read controls on a form before WPF.

private void HideControls()
{
foreach (Control c in Controls)
{
if (c.Controls.Count > 0)
{

}
else
{
if (c.Visible)
{

foreach (BUI.ApplicationHiddenField d in ApplicationHiddenFieldCollection)
{
if (d.Field.ToLower().Equals(c.Name.ToLower())) c.Visible = false;
}

}
}
}
}