I'm using some application commands like New, Open, etc and I'd like to have their executed and CanExecute handlers in the viewmodel but I'm having trouble with it and I can't seem to find anything that solves this. I have a commandBinding like this and I have a NewCommand_Executed meghot in the viewmodel, which is the datacontext of my window.
<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.New" Executed="{Binding NewCommand_Executed}" CanExecute="Default_CanExecute" />
...
However, I get a parse exception for this with an inner exception saying: Unable to cast object of type 'System.Reflection.RuntimeEventInfo' to type 'System.Reflection.MethodInfo'. Can someone explain what I am missing or if there is a way to achieve what I'm trying?