Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable or Disable multiple controls in Silverlight

What is considered the best way of enabling or disabling multiple controls in Silverlight at the same time (textbox, combobox, autocompletebox and the like)?

  • I suppose I could bind the "IsEnabled" property of each control to a boolean property. That property only exists for interactive controls and not textblocks.

  • I could loop through the children recursively and set their properties appropriately, but that seems inelegant.

  • Ideally, I'd like to just set some disable-like property on the parent container of the controls, giving even the TextBlocks a disabled look similar to a Windows form.

Is there a way to just disable the parent container?

like image 938
Feckmore Avatar asked Feb 14 '26 13:02

Feckmore


1 Answers

Use the ContentControl Silverlight provides.

<ContentControl x:Name="GroupOfControls" >...Your controls...</ContentControl>

//Enable and Disable
GroupOfControls.IsEnabled = false;
like image 142
Sethles Avatar answered Feb 20 '26 20:02

Sethles