Close the dialog in order to fire closing event.