WebView

Embed web pages or raw HTML and interact with their navigation history.

WebView embeds live web content. It has no intrinsic content size, so place it in a fill row or give it explicit dimensions.

var help = new WebView
{
    Url = "https://example.com/help",
    AllowsBackGestures = true,
    HorizontalAlignment = HorizontalAlignment.Stretch,
    VerticalAlignment = VerticalAlignment.Stretch
};

Set either Url or Html. When Html is non-null it takes precedence:

preview.Html = markdownRenderer.Render(viewModel.Markdown);

Both properties are bindable, and changing the active value starts a new load.

Navigated receives the final address after a page finishes loading. NavigationFailed receives the localized failure description.

help.Navigated = url => viewModel.CurrentUrl = url;
help.NavigationFailed = message => viewModel.ShowError(message);

GoBack, GoForward, and Reload operate on the native browsing history. AllowsBackGestures enables the platform's back and forward swipe gestures.

Use EvaluateAsync to run JavaScript in the currently loaded document:

string? title = await help.EvaluateAsync("document.title");

Only evaluate content you control or deliberately trust. Embedded remote pages remain web content: account for network failures, untrusted navigation, and the app's transport-security configuration.

Use in-app Safari when the page should receive browser chrome, Reader support, and its own modal presentation.