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 开发者_Python百科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)
{
}
精彩评论