Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
XamContextMenu inside ListBoxItem -- Unable to bind command to XamMenuItem

If I use RelativeSource to get to the DataContext of the MainWindow, it doesn't work (binding errors about finding the source).

If I use ElementName to get to the DataContext of the MainWindow, same thing.

I also tried following this method to get at the correct DataContext:

See link below for a sample project showing my issue.  I have placed a breakpoint on the command, so all you need to do is left-click the "convert to" button to get the context menu to appear and then click "to text".  The breakpoint should be reached if the binding is correct.  The method that is used in the attached project uses the stackoverflow method, and doesn't have any binding errors, but the command is still not reached.

Thanks for the help!