Commands are somewhat like events in that they are based on actions in the user interface, a command can get triggered (just like an event). But unlike regular events like ‚click‘, commands are built in a way that makes it very easy to expose the same functionality at multiple places in an interface, with very little code duplication.
Iplementation contains three steps:
1. Step define xmlns:local in MainWindow.xaml and assign a MenuItem a Command
2.Step Create a new Class commandsaction.cs and write down the Actions for the controls.
3. Step create a new Class mycommands.cs and declare the classes from commandsaction.cs . MainWindow knows from now where the classes is located.