Reputation: 786
private void newmail_Click(object sender, RoutedEventArgs e)
{
Nieuweemail _nieuweEmail = new Nieuweemail(_username);
_nieuweEmail.Show();
}
When that window is closed, I want to call a function inside my main window that will execute.
_nieuweEmail.Closed += setContent();
I could do this if I could call it in the window that is going to be closed. But that's not the case. How can I detect this?
Upvotes: 2
Views: 1415
Reputation: 1264
Assuming setContent
and newmail_Click
are both methods in your main window...
private void newmail_Click(object sender, RoutedEventArgs e)
{
Nieuweemail _nieuweEmail = new Nieuweemail(_username);
_nieuweEmail.Closed += SetContentHandler;
_nieuweEmail.Show();
}
private void SetContentHandler(object sender, EventArgs e)
{
setContent();
}
Upvotes: 2