Partager via


WebView2CompositionControl.EnsureCoreWebView2Async Method

Definition

Overloads

EnsureCoreWebView2Async(CoreWebView2Environment)

Explicitly triggers initialization of the control's CoreWebView2. See the WebView2 class documentation for an initialization overview.

EnsureCoreWebView2Async(CoreWebView2Environment, CoreWebView2ControllerOptions)

Explicitly triggers initialization of the control's CoreWebView2. See the WebView2 class documentation for an initialization overview.

EnsureCoreWebView2Async(CoreWebView2Environment)

Explicitly triggers initialization of the control's CoreWebView2. See the WebView2 class documentation for an initialization overview.

public System.Threading.Tasks.Task EnsureCoreWebView2Async (Microsoft.Web.WebView2.Core.CoreWebView2Environment environment);
abstract member EnsureCoreWebView2Async : Microsoft.Web.WebView2.Core.CoreWebView2Environment -> System.Threading.Tasks.Task
override this.EnsureCoreWebView2Async : Microsoft.Web.WebView2.Core.CoreWebView2Environment -> System.Threading.Tasks.Task
Public Function EnsureCoreWebView2Async (environment As CoreWebView2Environment) As Task

Parameters

environment
CoreWebView2Environment

A pre-created CoreWebView2Environment that should be used to create the CoreWebView2. Creating your own environment gives you control over several options that affect how the CoreWebView2 is initialized. If you pass an environment to this method then it will override any settings specified on the CreationProperties property. If you pass null and no value has been set to CreationProperties then a default environment will be created and used automatically.

Returns

A Task that represents the background initialization process. When the task completes then the CoreWebView2 property will be available for use (i.e. non-null). Note that the control's CoreWebView2InitializationCompleted event will be invoked before the task completes.

Implements

Applies to

EnsureCoreWebView2Async(CoreWebView2Environment, CoreWebView2ControllerOptions)

Explicitly triggers initialization of the control's CoreWebView2. See the WebView2 class documentation for an initialization overview.

public System.Threading.Tasks.Task EnsureCoreWebView2Async (Microsoft.Web.WebView2.Core.CoreWebView2Environment environment = default, Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions controllerOptions = default);
abstract member EnsureCoreWebView2Async : Microsoft.Web.WebView2.Core.CoreWebView2Environment * Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions -> System.Threading.Tasks.Task
override this.EnsureCoreWebView2Async : Microsoft.Web.WebView2.Core.CoreWebView2Environment * Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions -> System.Threading.Tasks.Task
Public Function EnsureCoreWebView2Async (Optional environment As CoreWebView2Environment = Nothing, Optional controllerOptions As CoreWebView2ControllerOptions = Nothing) As Task

Parameters

environment
CoreWebView2Environment

A pre-created CoreWebView2Environment that should be used to create the CoreWebView2. Creating your own environment gives you control over several options that affect how the CoreWebView2 is initialized. If you pass an environment to this method then it will override any settings specified on the CreationProperties property. If you pass null (the default value) and no value has been set to CreationProperties then a default environment will be created and used automatically.

controllerOptions
CoreWebView2ControllerOptions

A pre-created CoreWebView2ControllerOptions that should be used to create the CoreWebView2. Creating your own controller options gives you control over several options that affect how the CoreWebView2 is initialized. If you pass a controllerOptions to this method then it will override any settings specified on the CreationProperties property. If you pass null (the default value) and no value has been set to CreationProperties then a default controllerOptions will be created and used automatically.

Returns

A Task that represents the background initialization process. When the task completes then the CoreWebView2 property will be available for use (i.e. non-null). Note that the control's CoreWebView2InitializationCompleted event will be invoked before the task completes.

Implements

Applies to