UI for WPF 2019.1.220.45, Windows 10 Pro 64, Visual Studio Community 2019 v16.0.3
I'm trying to attach a context menu to a draggable listbox item, and after a great deal of effort, I've finally gotten it to the point where I can right click anywhere on the item (except for when the cursor is over a control with its own context menu, which is desired behavior). So, this is functioning exactly as I want it to from a UI standpoint. The problem is that the moment I add a Click property to the menu item in the xaml, the app throws an exception during the construction of the listbox.
Here's the xaml
I had been trying to put the ContextMenu in the ListBoxItem template, but was having no luck, when I ran across a forum post somewere that suggested putting it in its style instead, and that's what we have here. You'll find it right about in the middle of the code - just a single MenuItem, "Restore port name". If I remove the MenuItem altogether, the app runs fine and when I right click on the ListBoxItem, an empty context menu pops up. If I add the MenuItem with no Click property, the context menu pops up and shows the menu item. Add the Click property definition and, boom! Exception thrown.
I'm attaching some pictures that include what the list box looks like and the exception warning and details.
I wanted to use the RadContextMenu, but the app wouldn't build because it only allows ContexMenu at that point. (Different exception)
Any suggestions as to what I might do to get it working?