Obuka
Vođeno učenje
Understand ASP.NET Core fundamentals - Training
Learn the fundamentals of building web applications with ASP.NET Core. This learning path teaches the basics required for front-end and back-end development with ASP.NET Core.
Ovaj preglednik više nije podržan.
Prijeđite na Microsoft Edge, gdje vas čekaju najnovije značajke, sigurnosna ažuriranja i tehnička podrška.
The CoreWebView2Environment
, CoreWebView2Controller
, and CoreWebView2
classes (or equivalent interfaces) work together so your app can host a WebView2 browser control and access its browser features. These three large classes expose a wide range of APIs that your host app can access to provide many categories of browser-related features for your users.
CoreWebView2Environment
class represents a group of WebView2 controls that share the same WebView2 browser process, user data folder, and renderer. From this CoreWebView2Environment
class, you create pairs of CoreWebView2Controller
and CoreWebView2
instances.CoreWebView2Controller
class is responsible for hosting-related functionality such as window focus, visibility, size, and input, where your app hosts the WebView2 control.CoreWebView2
class is for the web-specific parts of the WebView2 control, including networking, navigation, script, and parsing and rendering HTML.Cross-platform API implementation: Most of the WebView2 APIs are initially developed for C++, and then most of the C++ APIs are wrapped as C# APIs. This way, there is a consistent parallelism and equivalence across platforms and programming languages.
Overview of:
CoreWebView2Environment
CoreWebView2
CoreWebView2Controller
vs. WebView2
classes (UI framework-specific WebView2 element class like the WPF, WinForms, or WinUI WebView2
classes).or, equivalently:
ICoreWebView2Environment
ICoreWebView2
ICoreWebView2Controller
CoreWebView2Environment
represents a group of WebView2 controls that all share the following:
From the CoreWebView2Environment
, you create CoreWebView2Controller
and CoreWebView2
pairs. They always come together as a CoreWebView2Controller
and a corresponding CoreWebView2
.
CoreWebView2Controller
is responsible for all hosting-related functionality such as focus, visibility, size, and input.CoreWebView2
is for the web-specific parts of the WebView2 control, including networking, navigation, script, and parsing and rendering HTML.It's different if you are using a UI framework-specific WebView2 element class like our WPF, WinForms, or WinUI WebView2 classes.
Then, the WebView2 class can optionally take a CoreWebView2Environment
to use, and otherwise it will create a default CoreWebView2Environment
. Internally, the WebView2 class creates its CoreWebView2Controller
and CoreWebView2
from the CoreWebView2Environment
. The WebView2
exposes its CoreWebView2
as a CoreWebView2
property, but the CoreWebView2Controller
is kept private to the WebView2
class. This is because the WebView2
class is responsible for connecting all of the CoreWebView2Controller
functionality to the UI framework.
Obuka
Vođeno učenje
Understand ASP.NET Core fundamentals - Training
Learn the fundamentals of building web applications with ASP.NET Core. This learning path teaches the basics required for front-end and back-end development with ASP.NET Core.