Hi - thanks for the great component. I am currently using it in a project using the MVVM pattern and Prism and came across the problem of Command property on PopupMenuItem not being bound because the DataContext for a menu item is null.
The DataContext is null because the menu is hard coded, as in the examples, in XAML. The XAML uses an ItemsControl of some kind (eg ListBox) but does not have an items source, and does not need one, since the menu items are explicitly defined. This means
the Command property has not DataContext to bind to.
To fix this, I updated PopupMenu.Open to include the following code when opening:
Is this expected behaviour or am I using it incorrectly?
item => item.DataContext = item.DataContext ?? this.DataContext);