I think part of the reason for that might be to ensure that you don't edit the layout of a dialog while the dialog is open, since the layout in the code might've changed, but those changes wouldn't be reflected in the actual display until the dialog needed to be reopened, and, therefore, have to have been closed previously.