I have a context menu. It\'s bound to some collection and it has a defined ItemTemplate like this:
Although this is only a slight variation on Martin Harris's answer, I thought I'd share it anyway. I found it more useful specify a single command for the whole collection and also send along a CommandParameter:
Then you can determine what to do in the handler for the command:
private void CommandForAll_Executed(object sender, ExecutedRoutedEventArgs e)
{
var cmdParam = e.Paramater as ExpectedType
if (cmdParam != null)
//DoStuff...
}