I was wondering if there was a way to handle a WPF Application Exit event such that the exit was cancelled. The use case is that I have a client-server situation where the s
If you want stop the operating system being shut down, or at least clean up before it does, you need to handle the Application.SessionEnding.
Related: Handling System Shutdown in WPF