can you create a event for a dialog before it shows?

HI Guys,
Is it possible to create an event which you call rather than dialog1.show to see if the dialog is required.

I have made a Please Wait dialog which works really well however some times it is only flashed onto the screen and is a bit annoying.

I would like something like this

dialog1.PreShow
’ code to see if it is worth showing the dialog at all - probably using a dictionary of previous times it was displayed given the window it was called from

if true then
dialog1.show
else
return
end if

dialog.PreShow(CurrentMethodName)

I can use a method in the session called PreShow and call the dialog from there but I was wondering if it is possible?

Also out of interest is it possible to send variable to the dialog show
I.e.
dialog1.show( “this is a required string”, 123456 , CurrentMethodName )

thanks
Damon