Skip to content

WebView2Wpf.EnsureCoreWebView2Async(CoreWebView2Environment) method

Defined in

Type: WebView2Wpf Namespace: CrissCross.WPF Assembly: CrissCross.WPF.WebView2.dll

Applies to

net10.0-windows7.0, net9.0-windows7.0, net8.0-windows7.0, net481

Overloads

  • 1. public Task EnsureCoreWebView2Async(CoreWebView2Environment environment)
  • 2. public Task EnsureCoreWebView2Async(CoreWebView2Environment? environment = null, CoreWebView2ControllerOptions? controllerOptions = null)

1. Overload

public Task EnsureCoreWebView2Async(CoreWebView2Environment environment)

View source

Summary: Ensures the core web view2 asynchronous.

Parameters

NameTypeDescription
environmentCoreWebView2EnvironmentThe environment.

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

2. Overload

public Task EnsureCoreWebView2Async(CoreWebView2Environment? environment = null, CoreWebView2ControllerOptions? controllerOptions = null)

View source

Summary: Ensures the core web view2 asynchronous.

Parameters

NameTypeDescription
environment = nullCoreWebView2Environment?The environment.
controllerOptions = nullCoreWebView2ControllerOptions?The controller options.

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