I have WPF application which will use some windows form control (ReportViewer) and ActiveX control (PivotTable from OWC), so naturally I am hosting those controls in a WindowsFormsHost element in WPF. The code is something like this:
<WindowsFormsHost Name="windowsFormsHost1" Height="Auto" MinHeight="400" MinWidth="400"><viewer:ReportViewer x:Name="viewerInstance" /></WindowsFormsHost>
Note these controls have built-in context menus(which are really mysterious where they come from because I can't find them in elements' properties). The functions in these context menus are useful to us but I'd like to add some new items to the existing menus. So now my question is simply: how I can do that? I can't set my customized context menu to WindowsFormsHost element, because that will overwrite/shadow the WinForms/ActiveX controls' context menus. And as I mentioned ealier I can't find the context menu property from those controls (I thought if I could find it I could modify there directly). For example, both viewerInstance.ContextMenu or viewInstance.ContextMenuStrip return nothing. So how can I add new context menu items while still keeping the old one?