Пример #1
0
 private void OnNavigationCompleted(WebView2NavigationCompletedEventArgs args)
 {
     IsLoading = false;
     if (args.WebErrorStatus != default)
     {
         // Use `e.WebErrorStatus` to vary the displayed message based on the error reason
         IsShowingFailedMessage = true;
     }
 }
Пример #2
0
 private void OnNavigationCompleted(WebView2 sender, WebView2NavigationCompletedEventArgs args)
 {
     IsLoading = false;
     OnPropertyChanged(nameof(BrowserBackCommand));
     OnPropertyChanged(nameof(BrowserForwardCommand));
     if (args.WebErrorStatus != default)
     {
         // Use `e.WebErrorStatus` to vary the displayed message based on the error reason
         IsShowingFailedMessage = true;
     }
 }
        private void _wv_NavigationCompleted(WebView2 sender, WebView2NavigationCompletedEventArgs args)
        {
            if (!args.IsSuccess)
            {
                return;
            }
            var json = LoadJsonFromEmbeddedResource(_wv.Source.Host);

            tbScript.Text       = json;
            butInject.IsEnabled = true;
        }
Пример #4
0
        async void OnNavigationCompleted(WWebView sender, WebView2NavigationCompletedEventArgs e)
        {
            // TODO WINUI3
            //if (e.Uri != null)
            //	SendNavigated(new UrlWebViewSource { Url = e.Uri.AbsoluteUri }, _eventState, WebNavigationResult.Success);
            Uri uri = sender.Source;

            if (uri != null)
            {
                SendNavigated(new UrlWebViewSource {
                    Url = uri.AbsoluteUri
                }, _eventState, WebNavigationResult.Success);
            }

            UpdateCanGoBackForward();

            if (Element.OnThisPlatform().IsJavaScriptAlertEnabled())
            {
                await Control.ExecuteScriptAsync("window.alert = function(message){ window.external.notify(message); };");
            }
        }
 private void OnWebViewNavigationCompleted(WebView2 sender, WebView2NavigationCompletedEventArgs args)
 {
     NavigationCompleted?.Invoke(this, args.WebErrorStatus);
 }