Eto DynamicLayout Size Before Initialization

My tests are based on in

I was writing my own form when I saw that collapsible sample and realized that it is not working.
It crashes cause the size of an invisible layout seems to be unknown until it is visible.
Then, when the button event tries to add hidden layout size to visible size, values are wrong.

self.ClientSize = drawing.Size(max(self.ClientSize.Width, self.collapsePanel.Width), self.ClientSize.Height + self.collapsePanel.Height)

The first time the button event is triggered self.collapsePanel.Height equates 0.

I tried to collapse it at start and it isn’t really neat visually and programmatically.

So, if I want to start a dialog with a hidden part …
Is there a way to pre-calculate size of layout without showing it ? (5.6 KB)

@curtisw, can you have a look at the above mentioned sample. This worked at one time. But I know much has changed.


– Dale