Please, read this:
How to use Commands in WPF[
^]. There you'll find an example of how to use "
Save
" and "
Cancel
" button.
If you would like to change the behaviour of command depending on state of application (in the wide sense of that statement), check this out:
Using WPF commands - The complete WPF tutorial[
^]
If you have any question to the author of the
original article[
^], please use "Add a comment or question" widget under the article.
Good luck!