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