/// <summary>
        /// Overrides NativeInit() method
        /// Does the initialization of native UI element
        /// </summary>
        protected internal override void NativeInit()
        {
            if (this.Parent != null && this.Context != null)
            {
                if (this.NativeUIElement == null)
                {
                    var webView = new WrappedWebView(this.Context);
                    this.WebViewClient = new WrappingWebViewClient(this);
                    webView.SetWebViewClient(this.WebViewClient);
                    webView.SetWebChromeClient(new MyWebChromeClient());

                    webView.AddJavascriptInterface(new ExternalJsInterface(this), "external");

                    webView.Download += WebView_Download;
                    webView.Picture  += WebView_Picture;

                    this.NativeUIElement = webView;
                    if (this.Source != null)
                    {
                        this.Navigate(this.Source); //TODO: Check this
                    }
                }

                SetIsScriptEnabledNative(this.IsScriptEnabled);
                SetIsGeolocationEnabledNative(this.IsGeolocationEnabled);

                base.NativeInit();
            }
        }
예제 #2
0
        /// <summary>
        /// Overrides NativeInit() method
        /// Does the initialization of native UI element
        /// </summary>
        protected internal override void NativeInit()
        {
            if (this.Parent != null && this.Context != null)
            {
                if (this.NativeUIElement == null)
                {
                    var webView = new WrappedWebView(this.Context);
                    this.WebViewClient = new WrappingWebViewClient(this);
                    webView.SetWebViewClient(this.WebViewClient);
                    webView.SetWebChromeClient(new MyWebChromeClient());

                    webView.AddJavascriptInterface(new ExternalJsInterface(this), "external");

                    webView.Download += WebView_Download;
                    webView.Picture += WebView_Picture;

                    this.NativeUIElement = webView;
                    if (this.Source != null)
                    {
                        this.Navigate(this.Source); //TODO: Check this
                    }
                }

                SetIsScriptEnabledNative(this.IsScriptEnabled);
                SetIsGeolocationEnabledNative(this.IsGeolocationEnabled);

                base.NativeInit();
            }
        }