The difference between the teams (ICommand) and the Click event

When to use Commandand when to use an event Click?

Fe if I have ButtonUWP in my application, what should I use?

+4
source share
1 answer

When should I use the command and when should I use the Click event?

You have a big question, and I just answer: " It depends ." Because:

  • Command ICommand, , , . - .
  • , , , CanExecute, , . (, MyButton_Click). , , Command, ( , CanExecute - false).
  • Command, DataContext (ViewModel, MVVM). , (, MyButton_Click), , . , Command, , , , (ViewModel) .

, , , , , , , , (: " " " , - " ..) / .

+7

Source: https://habr.com/ru/post/1654967/


All Articles