I found a much simpler solution.
In the code behind for the UserControl:
NameScope.SetNameScope(contextMenu, NameScope.GetNameScope(this));
More Related Contents:
- Binding to static property
- WPF Databinding: How do I access the “parent” data context?
- WPF animation: binding to the “To” attribute of storyboard animation
- Why does the binding update without implementing INotifyPropertyChanged?
- How to detect broken WPF Data binding?
- OneWayToSource binding from readonly property in XAML
- What approaches are available to dummy design-time data in WPF?
- WPF CommandParameter is NULL first time CanExecute is called
- WPF ContextMenu woes: How do I set the DataContext of the ContextMenu?
- Data binding the TextBlock.Inlines
- What is it about DataTable Column Names with dots that makes them unsuitable for WPF’s DataGrid control?
- WPF Grid as ItemsPanel for a list dynamically bound to an ItemsControl
- WPF Binding to local variable
- WPF MVVM INotifyPropertyChanged Implementation – Model or ViewModel
- WPF: Display a bool value as “Yes” / “No”
- How can I reduce RadioButton binding code?
- How to bind a command in WPF to a double click event handler of a control?
- Does WPF databinding marshall changes to the UI Thread?
- Create contextmenus for datagrid rows
- How to bind xml to the WPF DataGrid correctly?
- Weird problem where Button does not get re-enabled unless the mouse is clicked
- WPF Databind Before Saving
- Different views / data template based on member variable
- WPF ComboBox performance problems by binding a large collections
- Setting DataContext within UserControl is affecting bindings in parent
- MarkupExtension that uses a DataBinding value
- Binding DynamicObject to a DataGrid with automatic column generation?
- How to access a control from a ContextMenu menuitem via the visual tree?
- Is there a way to determine where a WPF Binding is declared/created?
- How can I tell my DataTemplate to bind to a property in the PARENT ViewModel?