Q: I am building an application using the PDFViewWPF for PDF viewing and the PDFViewWPFTool project to edit PDFs. When the user right-clicks on the PDFViewWPF, a context menu pops up. I would like to disable this. How do I do that?
Turning this off is as simple as calling ToolManager.SuppressContextMenu = true.
This can also be done on a case by case basis, in case you have added your own content and would like to display your own context menu, by subscribing to the PDFViewWPF’s PreviewRightMouseButtonUp and calling ToolManager.SuppressContextMenu = true.
Also, the Tool class (and any derivative) also has an AddContextMenuItems function. This can be used as follows: ToolManager.CurrentTool.AddContextMenuItems to add the tools option to your own context menu, if you want to. This way, you can add your own options and then add the options for the currently active tools below or above.
A: It is actually the PDFViewWPFTools that are responsible for the ContextMenu, not the PDFViewWPF.