Adding a window listener to a WPF-Window?
How can I add an window/event listener/handler to a wpf-window? I want to kn开发者_如何学Goow, if the user wants to close the window.
You can override OnClosing inside the Window.xaml.cs.
You can subscribe to the Closing event of your Window. You can cancel the action using the EventArgs (and its Cancel property)
精彩评论