I have a wpf app with blazor integrated in it. I would like to disable certain features like dev tools and page zooming. To do this, you would generally modify WebView2 settings like so:
var coreWebView2 = webView2Control.CoreWebView2;coreWebView2.Settings.IsZoomControlEnabled = false;coreWebView2.Settings.AreDevToolsEnabled = false;The problem with the Blazor WebView is that it doesn't directly expose its underlying WebView2 properties to modify - at least that I haven't found. This is how I would expect to modify the WebView2 settings of a Blazor WebView:
private void BlazorWebView_Loaded(object sender, RoutedEventArgs e){ var webView2Control = blazorWebView.WebView; if (webView2Control?.CoreWebView2 != null) { webView2Control.CoreWebView2.Settings.IsZoomControlEnabled = false; webView2Control.CoreWebView2.Settings.AreDevToolsEnabled = false; }}This, however, won't work because WebView doesn't exist under the BlazorWebView.
My question is, is it actually possible to access the BlazorWebView underlying WebView2 settings? If you truly can't, how could you disable dev tools and page zooming in the BlazorWebView?