简体   繁体   中英

How I can notify wpf owned window of closing?

If i set a owned window like that:

OwnedWindow ownedWindow = new OwnedWindow();
ownedWindow.Owner = this;
ownedWindow.Show();

it' possible to get notificated about the ownedWindow closing?

Yes.

OwnedWindow ownedWindow = new OwnedWindow();
ownedWindow.Owner = this;
ownedWindow.Closing += new System.ComponentModel.CancelEventHandler(ownedWindow_Closing);
ownedWindow.Show();

This handler should be in owner window.

void ownedWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM