WebView2.Source Property

Definition

The top-level Uri which the WebView is currently displaying (or will display once initialization of its CoreWebView2 is finished). Generally speaking, getting this property is equivalent to getting the Source property and setting this property (to a different value) is equivalent to calling the Navigate(String) method.

public Uri Source { get; set; }
member this.Source : Uri with get, set
Public Property Source As Uri

Property Value

Uri

Implements

Exceptions

Thrown if Dispose(Boolean) has already been called on the control.

Thrown if the property is set to null.

Thrown if the property is set to a relative Uri (i.e. a Uri whose IsAbsoluteUri property is false).

Remarks

Getting this property before the CoreWebView2 has been initialized will retrieve the last Uri which was set to it, or null (the default) if none has been. Setting this property before the CoreWebView2 has been initialized will cause initialization to start in the background (if not already in progress), after which the WebView2 will navigate to the specified Uri. This property can never be set back to null or to a relative Uri. See the WebView2 class documentation for an initialization overview.

Applies to

See also