How can I add an window/event listener/handler to a wpf-window? I want to know, if the user wants to close the window.
+1
A:
You can subscribe to the Closing event of your Window. You can cancel the action using the EventArgs (and its Cancel property)
Jalfp
2010-01-15 15:52:27
Where can i find the Window.xaml.cs-file?
elr
2010-01-18 14:08:10
The actual name depends on the name of the XAML file (they are both generated when adding a WPF Window). It will be [Windowname].xaml.cs
winSharp93
2010-01-18 19:10:35