When should I use the
When should I use the Command and when to use the Click event?
Yours is a broad question and I would simply answer with: "It depends". Because:
ICommandinterface and this means more code to add to your application but usually this won't change. Instead, the event handler doesn't require any interface implementation.
CanExecutelogic, to say when the command can execute. This is not requested in a simple event handler (like MyButton_Click). This means that, using a
Command, you will have more control in the elements on your UI (the button won't execute anything if
Command, you will bind it to your DataContext (the ViewModel, if you implement the MVVM pattern). Instead, when you add a simple event handler (like MyButton_Click), the code will be placed in your code-behind that is the logic behind your main window. This means that implementing a
Command, according to me, you'll have everything you need to modify in just one place (the ViewModel) instead of scattered logic anywhere in your project.
Of course, you can use whatever you want and my points are there just to give you an insight about these different implementations and you have to consider which solution is suitable for you, considering also the requirements you have been given (like: "Don't use event handlers" or "The Command is too advanced, let's just use something simple", etc.) and/or other constraints in your project.