private void SetHeightFromRootBox(RootSite rs)
{
if (rs.RootBox != null)
{
//Debug.WriteLine(String.Format("ViewSlice.SetHeightFromRootBox(): orig rs.Size = {0}, this.Size = {1}",
// rs.Size.ToString(), this.Size.ToString()));
int widthOrig = rs.Width;
this.Height = Math.Max(LabelHeight, DesiredHeight(rs)); // Allow it to be the height it wants.
//Debug.WriteLine(String.Format("ViewSlice.SetHeightFromRootBox(): new rs.Size = {0}, this.Size = {1}",
// rs.Size.ToString(), this.Size.ToString()));
if (widthOrig != rs.Width)
{
// If the rootsite width changes, we need to layout again. See LT-6156. (This is too much
// like a band-aid, but it's taken me 3 days to figure even this much out!)
rs.AllowLayout = true;
this.Height = Math.Max(LabelHeight, DesiredHeight(rs));
// Debug.WriteLine(String.Format("ViewSlice.SetHeightFromRootBox(): final rs.Size = {0}, this.Size = {1}",
// rs.Size.ToString(), this.Size.ToString()));
}
}
}