My WPF maintenance window have a toolbar with a button “Exit”; a CommandExit is bind with this button. The CommandExit perform some checks before exit.
Now, if I click to close button of the window (x-button of title bar), this checks are ignored.
How can I do to bind CommandExit to window x-button?
You have to implement event handler of your main window’s event “Closing” where you can do checks and cancel the closing action. This is easiest way to do it, however otherwise you have to redesign whole window and its theme.