I've responded to the ticket created on the issue tracker, but will put the reply here usability as well.
Note this has been tested with Catel v5, but should work with v4 as well.
I made 2 changes:
1.I create the command at startup:
var commandManager = ServiceLocator.Default.ResolveType<ICommandManager>();
commandManager.CreateCommand("AddToCollectionCommand");
Then I register an action for the command inside the VM:
commandManager.RegisterCommand("AddToCollectionCommand", AddToCollectionCommand, this);
2.You have to bind the command first, then the command parameter in xaml (order matters, although it shouldn't, but that's a xaml parsing issue we can't fix):
<!-- now works! -->
<catel:EventToCommand Command="{catel:CommandManagerBinding AddToCollectionCommand}"
CommandParameter="{Binding SelectedDataItem}"
DisableAssociatedObjectOnCannotExecute="False" />
I recommend that you also look into application-wide command containers. They are extremely powerful and allow you to separate concerns. You can find the docs here:
http://docs.catelproject.com/vnext/catel-mvvm/commands-events/application-wide-commands
If you use Orchestra (see https://github.com/wildgums/orchestra), you can even remap the app-wide commands input gestures with a ready-to-use UI.