title: WPF how to reset grid row and column sizes to "*" in code
body: <p>I have a grid that contains several controls in rows of a grid.  I have the RowDefinitions set so that each row in the grid has a height of "*" in the XAML, so that all the controls have the same amount of room available to them.</p>
  
  <p>I have a configuration screen that allows the user to disable/enable some of the controls.  If a control is disabled, I change the Visibility to Collapsed and set its row height in the grid to zero.  This works great on application start up.</p>
  
  <p>The issue is that if the user goes into the settings screen and re-enables controls (that were previously hidden) while the application is already running, I'm not sure how to set the control's grid column back to the correct size, and make it re-distribute all the available height among the new (increased) number of rows.</p>
  
  <p>Is there a way to set all the heights back to "*" in C# code, and have WPF do the redistribution?</p>
  
  <p>If not, any other ideas, other than doing the math myself and manually setting the row heights, or restarting the whole application?</p>