I have this context menu resource:
You are getting this error because CommandBinding.Executed is not dependency property so you cannot bind to it.
Instead, use ResourceDictionary code behind to specify event handler for CommandBinding.Executed event, and in the event handler code call FooViewModel.HelpExecuted() method like this:
MainWindowResourceDictionary.xaml
MainWindowResourceDictionary.xaml.cs
public partial class MainWindowResourceDictionary : ResourceDictionary
{
public MainWindowResourceDictionary()
{
InitializeComponent();
}
private void HelpExecuted(object sender, ExecutedRoutedEventArgs e)
{
var fooViewModel = (FooViewModel)((FrameworkElement)e.Source).DataContext;
fooViewModel.HelpExecuted();
}
}