title: WPF WebView2 - not able to disable Context Menu
body: <p><strong>Environment</strong>: <code>Windows 10 Pro - ver. 1903</code>, <code>VS2019 latest version</code>, <code>WPF Core</code></p>
  <p>When I have a manual control on an <code>HTML</code> page displayed inside <a href="https://docs.microsoft.com/en-us/microsoft-edge/webview2/" rel="noreferrer">WebView2</a> control, I can disable the context menu by simply adding <code>oncontextmunu={return false;}</code> as an attribute to <code>&lt;body&gt;</code> tag. But in most cases the web page is displayed based on user interaction (what page user navigates to etc.).</p>
  <p><strong>Question</strong>: How can we disable to context menu of a webpage displayed in WebView2 control?</p>
  <p><strong>Remarks</strong>:</p>
  <ol>
  <li>I have noticed that in some cases where a JavaScript is loaded along with a webpage, the <code>oncontextmunu={return false;}</code> does not disable the context menu even if I add this attribute programmatically to the <code>body</code> tag of loaded page. I see <code>AreDefaultContextMenusEnabled</code> property of <a href="https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/dotnet/0-9-515/microsoft-web-webview2-core-corewebview2settings" rel="noreferrer">Microsoft.Web.WebView2.Core.CoreWebView2Settings</a> class but <code>VS2019</code> does not recognize any such property for <code>WebView2</code>.</li>
  <li>There was a similar issue on the old <code>WebBrowser</code> control of WPF as described <a href="https://stackoverflow.com/q/5507734/1232087">here</a> and <a href="https://stackoverflow.com/q/4412915/1232087">here</a>, and I have the similar situation for WebView2.</li>
  <li>According to bullet 5 of this <a href="https://docs.microsoft.com/en-us/microsoft-edge/webview2/releasenotes#08314" rel="noreferrer">Microsoft link</a> the issue was resolved. But the solution there seems to be related to <code>C++</code> while I'm using <code>C#</code>. Maybe, there is an alternative.</li>
  </ol>