Skip to content

WebView2.Win32 markup reference

Fluent extensions declared by the Aprillz.MewUI.WebView2.Win32 package.

Receiver: WebView2.

Method Sets Summary
BrowserExecutableFolder(string value) BrowserExecutableFolder Sets the folder of the WebView2 runtime to use, or null for the installed runtime; throws InvalidOperationException when set after the environment is created.
ControllerOptions(WebViewControllerOptions value) ControllerOptions Sets the options used when creating the WebView2 controller, or null for the defaults; throws InvalidOperationException when set after the controller is created.
DefaultBackgroundColor(Color? value) DefaultBackgroundColor Sets the default background color of the WebView controller; null keeps the WebView2 default, and a translucent color throws ArgumentException.
OnContentLoading(Action<WebViewContentLoadingEventArgs> handler) event ContentLoading Subscribes handler to ContentLoading. Occurs when content starts loading.
OnCoreWebView2InitializationCompleted(Action<WebViewInitializationCompletedEventArgs> handler) event CoreWebView2InitializationCompleted Subscribes handler to CoreWebView2InitializationCompleted. Occurs when the CoreWebView2 initialization has completed.
OnDocumentTitleChanged(Action<string> handler) event DocumentTitleChanged Subscribes handler to DocumentTitleChanged. Occurs when the document title changes.
OnFrameNavigationCompleted(Action<WebViewNavigationCompletedEventArgs> handler) event FrameNavigationCompleted Subscribes handler to FrameNavigationCompleted. Occurs when frame navigation has completed.
OnNavigationCompleted(Action<WebViewNavigationCompletedEventArgs> handler) event NavigationCompleted Subscribes handler to NavigationCompleted. Occurs when navigation has completed.
OnNavigationStarting(Action<WebViewNavigationStartingEventArgs> handler) event NavigationStarting Subscribes handler to NavigationStarting. Occurs when navigation starts.
OnNewWindowRequested(Action<WebViewNewWindowRequestedEventArgs> handler) event NewWindowRequested Subscribes handler to NewWindowRequested. Occurs when a new window is requested.
OnSourceChanged(Action<WebViewSourceChangedEventArgs> handler) event SourceChanged Subscribes handler to SourceChanged. Occurs when Source changes.
OnWebMessageReceived(Action<WebViewWebMessageReceivedEventArgs> handler) event WebMessageReceived Subscribes handler to WebMessageReceived. Occurs when a message is received from the web content.
OnZoomFactorChanged(Action handler) event ZoomFactorChanged Subscribes handler to ZoomFactorChanged. Occurs when ZoomFactor changes.
Options(WebViewEnvironmentOptions value) Options Sets the environment options, or null for the defaults; throws InvalidOperationException when set after the environment is created.
Source(Uri value) Source Sets the URI of the top-level document.
UseSharedEnvironment(bool value = true) UseSharedEnvironment Sets whether this control shares one WebView2 environment with the other controls that do; throws InvalidOperationException when set after the environment is created.
UserDataFolder(string value) UserDataFolder Sets the user data folder, or null for the default; throws InvalidOperationException when set after the environment is created.
ZoomFactor(double value) ZoomFactor Sets the zoom factor for the WebView.