tags:

views:

26

answers:

1

Is there a way to suscribe one window event for look when another window close itself? I need to ask some details in the other window, once I get the details, then I close that window, the main window needs to know that.

Thanks.

+3  A: 

Whichever class constructs the window should be able to subscribe an eventhandler from the handler window to the .Closing event of the window you want it to respond to.

SomeWindow window = new SomeWindow();
window.Closing += otherWindow.ClosingEventhandler;
window.Show();
Jimmy Hoffa
I was studying events, event handling and all that stuff but doesn't understand until saw your example. Pragmatic, concise and precise, thanks a lot!
Sheldon