WPF - How to generate an event after the screen is shown

Hi,

I use the following functions to call one program within another:

method-id RegistoCartoesX public.
01 telaMenu type WPFApplication1.CA_RegCartao.
procedure division.
set telaMenu to new WPFApplication1.CA_RegCartao
invoke telaMenu::CA_RegCartao_Ini(lda-rec)
invoke telaMenu::ShowDialog()
end method.

 

This works fine and the screen of the second program is shown when the command "invoke screenMenu :: ShowDialog ()" is executed.
At this point the screen is waiting for user action.

Now what I need is when the screen is shown to perform another function that can be the flame of another screen / program, ie, I need that after the screen is shown to perform an action without the intervention of the user.

For example: the screen that is shown has a data grid with the names of the clients. If the number of clients is less than five, another screen / program must be called to enter more customer names.

Thanks

Alberto Ferraz