NativeWebDialog
Overview
NativeWebDialog
is a dialog window that hosts a native web browser implementation. It provides a way to display web content in a separate window, particularly useful for platforms like Linux where embedded WebView controls might not be available.
Properties
Title
public string? Title { get; set; }
Gets or sets the dialog window title.
CanUserResize
public bool CanUserResize { get; set; }
Gets or sets whether the dialog can be resized by the user.
Source
public Uri Source { get; set; }
The URI of the top-level document displayed in the WebView. Setting this property is equivalent to calling Navigate()
.
Default value: about:blank
CanGoBack
public bool CanGoBack { get; }
Indicates whether the WebView can navigate to a previous page in the navigation history.
CanGoForward
public bool CanGoForward { get; }
Indicates whether the WebView can navigate to a next page in the navigation history.
Events
Closing
public event EventHandler Closing;
Fires before the WebView dialog is closed.
AdapterCreated
public event EventHandler<WebViewAdapterEventArgs>? AdapterCreated;
Fires after underlying webview adapter was initialized.
AdapterDestroyed
public event EventHandler<WebViewNavigationCompletedEventArgs>? AdapterDestroyed;
Fires after underlying webview adapter was destroyed.
EnvironmentRequested
public event EventHandler<WebViewEnvironmentRequestedEventArgs>? EnvironmentRequested;
Fired before the underlying webview adapter is created, allowing customization of the webview environment. Use this event to modify environment options (such as enabling private mode or dev tools) before the webview is initialized. The event argument type depends on the platform.
See WebView Environment Options for more details.
NavigationCompleted
public event EventHandler<WebViewNavigationCompletedEventArgs>? NavigationCompleted;
Fires after navigation of the top-level document completes rendering, either successfully or unsuccessfully.
NavigationStarted
public event EventHandler<WebViewNavigationStartingEventArgs>? NavigationStarted;
Fires before a new navigation starts for the top-level document.
NewWindowRequested
public event EventHandler<WebViewNewWindowRequestedEventArgs>? NewWindowRequested;
Fires before a new navigate starts for the top level document.
WebMessageReceived
public event EventHandler<WebMessageReceivedEventArgs>? WebMessageReceived;