共用方式為


CoreWebView2Environment.RestartRequested Event

Definition

Add an event handler for the RestartRequested event. RestartRequested event is raised when there is a need to restart WebView2 process in order to apply certain beneifical updates.

RestartRequested gives developers the awareness of these necessary WebView2 restarts, allowing developers to resolve issues faster than waiting for end users to restart the app. Developer might want to give end users the ability to save their state before restarting. For apps with multiple processes that host WebView2s that share the same user data folder you need to make sure all WebView2 instances are closed and the associated WebView2 Runtime browser process exits. See BrowserProcessExited for more details.

public event EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2RestartRequestedEventArgs> RestartRequested;
member this.RestartRequested : EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2RestartRequestedEventArgs> 
Public Custom Event RestartRequested As EventHandler(Of CoreWebView2RestartRequestedEventArgs) 

Event Type

Applies to