From the course: .NET 9 Maui: Enhanced Features for Cross-Platform Development

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

WebView ProcessTerminated event

WebView ProcessTerminated event

- [Instructor] A new event has been added to the WebView to capture if the internal platform WebView had an unexpected exception, that raises an error in the WebView itself. Exactly what underlying event causes this and what parameters are raised depends on the different platforms. I examined the underlying MAUI source code and found that the actual event parameter is compiled differently depending on the platform. This means that it would be very difficult to create a cross-platform implementation for this if we wanted to do anything with that parameter. On Android, the underlying control is a WebView client, and that uses the Android OnRenderProcessGone event. IOS and macOS use a WKWebView's webViewWebControlProcessDidTerminate event. Finally, Windows uses the WebView2's ProcessFailed event. The parameters passed to the ProcessTerminated event are the ones raised by the underlying platform events. Microsoft makes a point of saying that the underlying WebView will be an indeterminate…

Contents