WPF - 处理在所有者窗口中关闭的窗口



我在 WPF 4.5 中有以下代码:

private void Button_Click_2(object sender, RoutedEventArgs e)
    {
        SepararStockView SSV = new SepararStockView(StockIDSeparar)
              {
                  Title = "Separar Stock",
                  ShowInTaskbar = false,               // don't show the dialog on the taskbar
                  Topmost = true,                      // ensure we're Always On Top
                  ResizeMode = ResizeMode.NoResize,    // remove excess caption bar buttons
                  Owner = Application.Current.MainWindow,
              }; ;
    }

如何处理"子"窗口("SSV")的"关闭"以重新加载网格?

  1. 在子窗口中创建事件。
  2. 创建子窗口的实例时,在主窗口中在此处附加侦听器。
  3. 关闭子窗口时会引发该事件,以便可以在主窗口中侦听它。

最新更新