Bind the security event to the main window