I'm using IPopupService instance to open and close the popups.
IPopupService
I can elaborate it if you need further implementation.