Exemplo n.º 1
0
        public void RegisterNavigationEvents(WebView xamlWebView)
        {
            _parentWebView = xamlWebView;

            this.Configuration.Preferences.JavaScriptCanOpenWindowsAutomatically = true;
            this.Configuration.Preferences.JavaScriptEnabled = true;

            NavigationDelegate = new WebViewNavigationDelegate(
                //Removed the OnStarted Here because it was calling OnStarted Event twice, On NavigationCommited and OnNavigationStarted
                onNavigationCommited: null,
                onNavigationFinished: OnNavigationFinished,
                onNavigationFailed: OnError,
                onProvisionalNavigationStarted: OnStarted,
                onProvisionalNavigationFailed: OnError,
                onUnsupportedUriSchemeIdentified: OnUnsupportedUriSchemeIdentified
                );

            UIDelegate = new LocalWKUIDelegate(
                onCreateWebView: OnCreateWebView,
                didClose: OnDidClose,
                onRunJavaScriptAlertPanel: OnRunJavaScriptAlertPanel,
                onRunJavaScriptConfirmPanel: OnRunJavaScriptConfirmPanel,
                onRunJavaScriptTextInputPanel: OnRunJavaScriptTextInputPanel
                );
        }
Exemplo n.º 2
0
        public void RegisterNavigationEvents(WebView xamlWebView)
        {
            _parentWebView = xamlWebView;

            this.Configuration.Preferences.JavaScriptCanOpenWindowsAutomatically = true;
            this.Configuration.Preferences.JavaScriptEnabled = true;

            NavigationDelegate = new WebViewNavigationDelegate(this);

            UIDelegate = new LocalWKUIDelegate(
                onCreateWebView: OnCreateWebView,
                didClose: OnDidClose,
                onRunJavaScriptAlertPanel: OnRunJavaScriptAlertPanel,
                onRunJavaScriptConfirmPanel: OnRunJavaScriptConfirmPanel,
                onRunJavaScriptTextInputPanel: OnRunJavaScriptTextInputPanel
                );
        }