示例#1
0
        /// <summary>
        /// // Turn off this scenario if we navigate away from the sample page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WebView2DocumentStateChanged(object sender, Wrapper.DocumentStateChangedEventArgs e)
        {
            string url = _webView2.Source;

            if (url != _sampleUri)
            {
                _parent.DeleteComponent(this);
            }
        }
        /// <summary>
        /// Register a handler for the DocumentStateChanged event.
        /// This handler will read the webview's source URI and update
        /// the app's address bar.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WebView2DocumentStateChanged(object sender, Wrapper.DocumentStateChangedEventArgs e)
        {
            string source = _webView2.Source;

            if (source == "about::blank")
            {
                source = "";
            }
            _toolbar.Url = source;
        }