If I have page 2 open on top of page 1, when I close page 2, the shown event in page 1 fires. This is as expected.
If page 1 opens a web dialog on top of itself, when the web dialog closes, the shown event on page 1 does not fire. I wish it did! Is there a way to make the shown event fire when a web dialog closes on a page? Or some other way to achieve the same effect? I want to put code into the event to make page 1 update its own content.
Steve, I am not convinced that the shown event should be fired, The page is already shown and the dialog is a child of page 1, if i understand the situation correctly.
Perhaps there is a different way to achieve your goal. You can manage whatever logic is needed on page 1 when closing the dialog, by creating a handler method on page 1 for the dismissed event of the dialog. I do it often to update information on a page upon closing a dialog, and to execute further logic as required.
for example, say you have a standard address management dialog. On page 1, you would have this somewhere, presumably in the method that spawns the dialog:
Var wdAddressCheckDialog As New wdAddressCheckBase
AddHandler wdAddressCheckDialog.Dismissed, WeakAddressOf wdAddressCheckDialog_Dismissed
You would also have a method called (in this spoecific case) wdAddressDialog_Dismissed, with this signature: Public Sub wdAddressCheckDialog_Dismissed(wdAddressCheckDialog as wdAddressCheckBase)
In every such handler, I always remove the handler once the logic is completed to avoid a memory leak:
Thanks. I’m not saying that it should - I was expecting the behaviour to be similar to the desktop framework where it does happen in the way I suggested.
I’ve implemented a version of what you suggested - thanks for the pointers.