/// <summary>
 /// Closes the webview and cleans up the underlying browser instance.
 /// Cleaning up the browser instace will release the resources powering the webview.
 /// The browser instance will be shut down if there are no other webviews using it.
 ///
 /// After calling Close, all method calls will fail and event handlers
 /// will stop firing. Specifically, the WebView will release its references
 /// to its event handlers when Close is called.
 /// </summary>
 public void Close()
 {
     if (_webView2WebView == null)
     {
         return;
     }
     UnregisterHandlers();
     _webView2WebView.Close();
 }