wpf Window_Closing cancel code example Example: how to detected WindowCloseEvent in other window wpf Window.Closed += Evenfunction;