Is there a way to hide the contextmenu on a ribbon?
I've tried this with a creation filter, but I can only remove the child elements, but not the parent ToolbarListMenuControlUIElement, so an empty "context menu" is still shown
#region IUIElementCreationFilter Members public void AfterCreateChildElements(UIElement parent) { if (parent is ToolbarListMenuControlUIElement) { parent.ChildElements.Clear(); } } public bool BeforeCreateChildElements(UIElement parent) { return false; } #endregion
That did the trick!
Really hadn't noticed that event... :)
You can handle the BeforeToolbarListDropdown event and set Cancel on the event args to True.