Not that complex actually (but still, M $ sucks in without providing it). Here you are:
public static class MyCommands { private static readonly ICommand appCloseCmd = new ApplicationCloseCommand(); public static ICommand ApplicationCloseCommand { get { return appCloseCmd; } } }
And the body of the AplicationCloseCommand.CanExecuteChanged event AplicationCloseCommand.CanExecuteChanged may not even be necessary.
You use it like this:
<MenuItem Header="{DynamicResource MenuFileExit}" Command="MyNamespace:MyCommands.ApplicationCloseCommand"/>
Hooray!
(You cannot imagine how long it took me to open this Command ... material)
Noone
source share