Make sure you have set arrangement to visible from designer.
I kept in unvisible. I want to keep arrangement visible only when internet gets disconnected or someone tries to open app without internet. So i cant keep visible in designer
Make it custom dialog on screen initialize so you do not have to make it visible and invisible again. It will be automatically invisible.And when you want to show it just show dialog.
I tried your method but dailogue isnt showing. But i will try again. Lets see what happens