WebViewControl WebViewControl WebViewControl WebViewControl WebViewControl Class

Definition

This class is an implementation of an IWebViewControl.

public : sealed class WebViewControl : IWebViewControlSite, IWebViewControlSite2, IWebViewControl, IWebViewControl2
struct winrt::Windows::Web::UI::Interop::WebViewControl : IWebViewControlSite, IWebViewControlSite2, IWebViewControl, IWebViewControl2
public sealed class WebViewControl : IWebViewControlSite, IWebViewControlSite2, IWebViewControl, IWebViewControl2
Public NotInheritable Class WebViewControl Implements IWebViewControlSite, IWebViewControlSite2, IWebViewControl, IWebViewControl2
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10, version 1803 (introduced v10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

Properties

Bounds Bounds Bounds Bounds Bounds

Gets or sets the bounds of the control.

CanGoBack CanGoBack CanGoBack CanGoBack CanGoBack

Gets a value that indicates whether there is at least one page in the backward navigation history.

For more info, see Windows.Web.UI.IWebViewControl

CanGoForward CanGoForward CanGoForward CanGoForward CanGoForward

Gets a value that indicates whether there is at least one page in the forward navigation history.

For more info, see Windows.Web.UI.IWebViewControl

ContainsFullScreenElement ContainsFullScreenElement ContainsFullScreenElement ContainsFullScreenElement ContainsFullScreenElement

Gets a value that indicates whether the control contains an element that supports full screen.

For more info, see Windows.Web.UI.IWebViewControl

DefaultBackgroundColor DefaultBackgroundColor DefaultBackgroundColor DefaultBackgroundColor DefaultBackgroundColor

Gets or sets the color to use as the control background when the HTML content does not specify a color.

For more info, see Windows.Web.UI.IWebViewControl

DeferredPermissionRequests DeferredPermissionRequests DeferredPermissionRequests DeferredPermissionRequests DeferredPermissionRequests

Gets a collection of permission requests that are waiting to be granted or denied.

For more info, see Windows.Web.UI.IWebViewControl

DocumentTitle DocumentTitle DocumentTitle DocumentTitle DocumentTitle

Gets the title of the page currently displayed in the control.

For more info, see Windows.Web.UI.IWebViewControl

IsVisible IsVisible IsVisible IsVisible IsVisible

Gets or sets a value that indicates if this control is invisible.

Process Process Process Process Process

Gets the process that the control is hosted in.

Scale Scale Scale Scale Scale

Gets or sets the scale of the window.

Settings Settings Settings Settings Settings

Gets a WebViewControlSettings object that contains properties to enable or disable IWebViewControl features.

For more info, see Windows.Web.UI.IWebViewControl

Source Source Source Source Source

Gets or sets the URI source of the HTML content to display in the control.

For more info, see Windows.Web.UI.IWebViewControl

Methods

AddInitializeScript(String) AddInitializeScript(String) AddInitializeScript(String) AddInitializeScript(String) AddInitializeScript(String)

Injects a script into a WebViewControl just after ContentLoading but before any other script is run on the page.

BuildLocalStreamUri(String, String) BuildLocalStreamUri(String, String) BuildLocalStreamUri(String, String) BuildLocalStreamUri(String, String) BuildLocalStreamUri(String, String)

Creates a URI that you can pass to NavigateToLocalStreamUri

For more info, see Windows.Web.UI.IWebViewControl

CapturePreviewToStreamAsync(IRandomAccessStream) CapturePreviewToStreamAsync(IRandomAccessStream) CapturePreviewToStreamAsync(IRandomAccessStream) CapturePreviewToStreamAsync(IRandomAccessStream) CapturePreviewToStreamAsync(IRandomAccessStream)

Creates an image of the current control contents and writes it to the specified stream.

For more info, see Windows.Web.UI.IWebViewControl

CaptureSelectedContentToDataPackageAsync() CaptureSelectedContentToDataPackageAsync() CaptureSelectedContentToDataPackageAsync() CaptureSelectedContentToDataPackageAsync() CaptureSelectedContentToDataPackageAsync()

Asynchronously gets a DataPackage that contains the selected content within the control.

For more info, see Windows.Web.UI.IWebViewControl

Close() Close() Close() Close() Close()

Closes the control.

GetDeferredPermissionRequestById(UInt32, WebViewControlDeferredPermissionRequest) GetDeferredPermissionRequestById(UInt32, WebViewControlDeferredPermissionRequest) GetDeferredPermissionRequestById(UInt32, WebViewControlDeferredPermissionRequest) GetDeferredPermissionRequestById(UInt32, WebViewControlDeferredPermissionRequest) GetDeferredPermissionRequestById(UInt32, WebViewControlDeferredPermissionRequest)

Returns the deferred permission request with the specified Id.

For more info, see Windows.Web.UI.IWebViewControl

GoBack() GoBack() GoBack() GoBack() GoBack()

Navigates the IWebViewControl to the previous page in the navigation history.

For more info, see Windows.Web.UI.IWebViewControl

GoForward() GoForward() GoForward() GoForward() GoForward()

Navigates the IWebViewControl to the next page in the navigation history.

For more info, see Windows.Web.UI.IWebViewControl

InvokeScriptAsync(String, IIterable<String>) InvokeScriptAsync(String, IIterable<String>) InvokeScriptAsync(String, IIterable<String>) InvokeScriptAsync(String, IIterable<String>) InvokeScriptAsync(String, IIterable<String>)

Executes the specified script function from the currently loaded HTML, with specific arguments, as an asynchronous action.

For more info, see Windows.Web.UI.IWebViewControl

MoveFocus(WebViewControlMoveFocusReason) MoveFocus(WebViewControlMoveFocusReason) MoveFocus(WebViewControlMoveFocusReason) MoveFocus(WebViewControlMoveFocusReason) MoveFocus(WebViewControlMoveFocusReason)

Move the focus.

Navigate(Uri) Navigate(Uri) Navigate(Uri) Navigate(Uri) Navigate(Uri)

Loads the HTML content at the specified Uniform Resource Identifier (URI).

For more info, see Windows.Web.UI.IWebViewControl

NavigateToLocalStreamUri(Uri, IUriToStreamResolver) NavigateToLocalStreamUri(Uri, IUriToStreamResolver) NavigateToLocalStreamUri(Uri, IUriToStreamResolver) NavigateToLocalStreamUri(Uri, IUriToStreamResolver) NavigateToLocalStreamUri(Uri, IUriToStreamResolver)

Loads local web content at the specified URI using an IUriToStreamResolver.

For more info, see Windows.Web.UI.IWebViewControl

NavigateToString(String) NavigateToString(String) NavigateToString(String) NavigateToString(String) NavigateToString(String)

Loads the specified HTML content as a new document.

For more info, see Windows.Web.UI.IWebViewControl

NavigateWithHttpRequestMessage(HttpRequestMessage) NavigateWithHttpRequestMessage(HttpRequestMessage) NavigateWithHttpRequestMessage(HttpRequestMessage) NavigateWithHttpRequestMessage(HttpRequestMessage) NavigateWithHttpRequestMessage(HttpRequestMessage)

Navigates the control to a URI with a POST request and HTTP headers.

For more info, see Windows.Web.UI.IWebViewControl

Refresh() Refresh() Refresh() Refresh() Refresh()

Reloads the current content in the control.

For more info, see Windows.Web.UI.IWebViewControl

Stop() Stop() Stop() Stop() Stop()

Halts the current control navigation or download.

For more info, see Windows.Web.UI.IWebViewControl

Events

AcceleratorKeyPressed AcceleratorKeyPressed AcceleratorKeyPressed AcceleratorKeyPressed AcceleratorKeyPressed

An event that is triggered when the accelerator key is pressed.

ContainsFullScreenElementChanged ContainsFullScreenElementChanged ContainsFullScreenElementChanged ContainsFullScreenElementChanged ContainsFullScreenElementChanged

An event that is triggered when the status of whether the control currently contains a full screen element or not changes.

For more info, see Windows.Web.UI.IWebViewControl

ContentLoading ContentLoading ContentLoading ContentLoading ContentLoading

An event that is triggered when the control has started loading new content.

For more info, see Windows.Web.UI.IWebViewControl

DOMContentLoaded DOMContentLoaded DOMContentLoaded DOMContentLoaded DOMContentLoaded

An event that is triggered when the control has finished parsing the current HTML content.

For more info, see Windows.Web.UI.IWebViewControl

FrameContentLoading FrameContentLoading FrameContentLoading FrameContentLoading FrameContentLoading

An event that is triggered when a frame in the control has finished parsing its current HTML content.

For more info, see Windows.Web.UI.IWebViewControl

FrameDOMContentLoaded FrameDOMContentLoaded FrameDOMContentLoaded FrameDOMContentLoaded FrameDOMContentLoaded

An event that is triggered when a frame in the control has finished parsing its current HTML content.

For more info, see Windows.Web.UI.IWebViewControl

FrameNavigationCompleted FrameNavigationCompleted FrameNavigationCompleted FrameNavigationCompleted FrameNavigationCompleted

An event that is triggered when a frame in the control has finished loading its content.

For more info, see Windows.Web.UI.IWebViewControl

FrameNavigationStarting FrameNavigationStarting FrameNavigationStarting FrameNavigationStarting FrameNavigationStarting

An event that is triggered before a frame in the control navigates to new content.

For more info, see Windows.Web.UI.IWebViewControl

GotFocus GotFocus GotFocus GotFocus GotFocus

Informs your app when the WebViewControl receives focus (due to the user clicking inside/outside the WebViewControl). Use in combination with the LostFocus event and programmatic focus changes using the WebViewControl.MoveFocus method.

LongRunningScriptDetected LongRunningScriptDetected LongRunningScriptDetected LongRunningScriptDetected LongRunningScriptDetected

An event that is triggered periodically while the control executes JavaScript, letting you halt the script.

For more info, see Windows.Web.UI.IWebViewControl

LostFocus LostFocus LostFocus LostFocus LostFocus

Informs your app when the WebViewControl loses focus. May be initiated by the user clicking inside/outside the WebViewControl or by a programmatic focus change, such as the app calling SetFocus on a window that is not the WebViewControl or a MoveFocus method call.

MoveFocusRequested MoveFocusRequested MoveFocusRequested MoveFocusRequested MoveFocusRequested

An event that is triggered when a focus move is requested.

NavigationCompleted NavigationCompleted NavigationCompleted NavigationCompleted NavigationCompleted

An event that is triggered when the control has finished loading the current content or if the navigation has failed.

For more info, see Windows.Web.UI.IWebViewControl

NavigationStarting NavigationStarting NavigationStarting NavigationStarting NavigationStarting

An event that is triggered before the control navigates to new content.

For more info, see Windows.Web.UI.IWebViewControl

NewWindowRequested NewWindowRequested NewWindowRequested NewWindowRequested NewWindowRequested

An event that is triggered when a user performs an action in the control that causes content to be opened in a new window.

For more info, see Windows.Web.UI.IWebViewControl

PermissionRequested PermissionRequested PermissionRequested PermissionRequested PermissionRequested

An event that is triggered when an action in the control requires that permission to be granted.

For more info, see Windows.Web.UI.IWebViewControl

ScriptNotify ScriptNotify ScriptNotify ScriptNotify ScriptNotify

An event that is triggered when the content contained in the control passes a string to the app using window.external.notify.

For more info, see Windows.Web.UI.IWebViewControl

UnsafeContentWarningDisplaying UnsafeContentWarningDisplaying UnsafeContentWarningDisplaying UnsafeContentWarningDisplaying UnsafeContentWarningDisplaying

An event that is triggered when the control shows a warning page for content that was reported as unsafe by SmartScreen Filter.

UnsupportedUriSchemeIdentified UnsupportedUriSchemeIdentified UnsupportedUriSchemeIdentified UnsupportedUriSchemeIdentified UnsupportedUriSchemeIdentified

An event that is triggered when an attempt is made to navigate to a URI using a scheme that the control doesn't support.

For more info, see Windows.Web.UI.IWebViewControl

UnviewableContentIdentified UnviewableContentIdentified UnviewableContentIdentified UnviewableContentIdentified UnviewableContentIdentified

An event that is triggered when the control attempts to download an unsupported file.

For more info, see Windows.Web.UI.IWebViewControl

WebResourceRequested WebResourceRequested WebResourceRequested WebResourceRequested WebResourceRequested

An event that is fired when an HTTP request is made.

For more info, see Windows.Web.UI.IWebViewControl