Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide the context menu of Ribbon Control

I need to hide the context menu of Ribbon Control

Context Menu Appearing

I tried

<Ribbon.ContextMenu><ContextMenu Visibility="Hidden"></ContextMenu></Ribbon.ContextMenu>

This did the job upto some extent. ie it disables context menu when right clicked on empty space. But when i right click on a ribbon button, still the context menu appears. How can i disable this?

like image 304
Krishna Thota Avatar asked Jun 29 '13 01:06

Krishna Thota


1 Answers

Ribbon is a ribbon, you should not disable its features. If your "ribbon" really looks like this, consider using toolbars.

That being said, you can disable context menus by setting them to null on all controls on all levels of hierarchy:

<Ribbon ContextMenu="{x:Null}">
    <RibbonTab Header="abc" ContextMenu="{x:Null}">
        <RibbonGroup Header="abc" ContextMenu="{x:Null}">
            <RibbonButton Content="abc" ContextMenu="{x:Null}"/>
        </RibbonGroup>
    </RibbonTab>
</Ribbon>
like image 165
Athari Avatar answered Oct 07 '22 04:10

Athari