Parent window:<summary>
Pop-up window
</summary>
<param name= "Sender" ></param>
<param name= "E" ></param>
Privatevoid Mifuncset_click (object sender, RoutedEventArgs e)
{
Winfuncsetting funcsetting =new winfuncsetting ();
Funcsetting.changetextevent +=new Changetexthandler (funcsettingclosed);
Funcsetting.showdialog ();
}
To set the method to execute when the window is closed
void Funcsettingclosed ()
{//write the method you want to invoke, such as rebind the data source, change the value of a tag, etc.}child window:Namespace EFM. Functest.assist
{
Defining delegates
Publicdelegatevoid Changetexthandler ();
<summary>
The interactive logic of Funcsetting.xaml
</summary>
Publicpartialclass Winfuncsetting:window
{
Publicevent Changetexthandler changetextevent;
Public winfuncsetting ()
{
InitializeComponent ();
}//Window Close Event
you can trigger the event after any action you need, and I'm here to write it down in the window.
Privatevoid window_closed (object sender, EventArgs e)
{
Strikeevent ();
}
Trigger event changes the value of MainWindow
Privatevoid strikeevent ()
{
if (changetextevent!=null)
{
Changetextevent ();
}
}}
Refresh the parent window after WPF or WinForm closes a child window or a child window