What do you mean by close it and open it?
If you mean that you Remove the UI from the screen (close), and then re-add the same instance of that UI to the screen (open), the only solutions I know of right now are to either hide the UI (not remove), or recreate the UI each time (rather than create once, and re-add the same instance).