Search code examples
c#wpfmvvmevent-handlingicommand

What comes first - Command or EventHandler?


In context of Microsoft's MVVM pattern and its Commanding/Event Handling aspects consider I am doing both binding a Command to a Control (say a Button) and subscribing to the control's Click event.

Is there any general rule what action takes place first - the processing of the code associated with the command or the one associated with the corresponding event handler?


Solution

  • EventHandlers are triggered before the bound ICommand.