I've a WPF application which allows me to edit some data.
I would like to make that if we try to close the application, the user must acknowledge that he will lost its modifications.
But here we are, I got several problem:
- There is no "Closing" commands on the windows object(I can execute a command when I have an event from the code behind I guess)
- I don't know how it's the recommended way to cancel something with the MVVM pattern? Normally I would have put the
e.Cancel = true;
, but we can't because it's a command
So how would you ask the user if he is sure to close the windows, with the MVVM pattern?