Esempio n. 1
0
        public Task LoadBrowserUri(string uri)
        {
            Uri = uri;

            if (HelpViewWrapper == null)
            {
                IsViewAvailable = false;
            }
            else
            {
                IsViewAvailable = true;
                HelpViewWrapper.WebBrowser.NavigationService.NavigationFailed += (sender, args) =>
                {
                    ResourcePath = FileHelper.GetFullPath(StringResources.Uri_Studio_PageNotAvailable);
                    Execute.OnUIThread(() =>
                    {
                        HelpViewWrapper.Navigate(ResourcePath);
                        HelpViewWrapper.CircularProgressBarVisibility = Visibility.Collapsed;
                        HelpViewWrapper.WebBrowserVisibility          = Visibility.Visible;
                    });
                };
                HelpViewWrapper.WebBrowser.LoadCompleted += (sender, args) => Execute.OnUIThread(() =>
                {
                    HelpViewWrapper.CircularProgressBarVisibility = Visibility.Collapsed;
                    HelpViewWrapper.WebBrowserVisibility          = Visibility.Visible;
                });
                Execute.OnUIThread(() => { HelpViewWrapper.Navigate(Uri); });
            }
            return(Task.FromResult(true));
        }
Esempio n. 2
0
 void SetupFailedNavigationEvent()
 {
     HelpViewWrapper.WebBrowser.NavigationService.NavigationFailed += (sender, args) =>
     {
         ResourcePath = FileHelper.GetFullPath(StringResources.Uri_Studio_PageNotAvailable);
         Execute.OnUIThread(() =>
         {
             HelpViewWrapper.Navigate(ResourcePath);
             HelpViewWrapper.CircularProgressBarVisibility = Visibility.Collapsed;
             HelpViewWrapper.WebBrowserVisibility          = Visibility.Visible;
         });
     };
 }
Esempio n. 3
0
        public Task LoadBrowserUri(string uri)
        {
            Uri = uri;

            if (HelpViewWrapper == null)
            {
                IsViewAvailable = false;
            }
            else
            {
                IsViewAvailable = true;
                SetupFailedNavigationEvent();
                SetupLoadCompletedEvent();
                SetupNavigationCompletdEvent();
                Execute.OnUIThread(() => { HelpViewWrapper.Navigate(Uri); });
            }
            return(Task.FromResult(true));
        }
Esempio n. 4
0
        public async Task LoadBrowserUri(string uri)
        {
            Uri = uri;

            if (HelpViewWrapper == null)
            {
                IsViewAvailable = false;
            }
            else
            {
                IsViewAvailable = true;
                //_network.HasConnectionAsync(uri).ContinueWith(task =>
                //{
                //var hasConnection = task.Result;
                var hasConnection = await _network.HasConnectionAsync(uri);

                if (hasConnection)
                {
                    HelpViewWrapper.WebBrowser.Navigated     += (sender, args) => SuppressJavaScriptsErrors(HelpViewWrapper.WebBrowser);
                    HelpViewWrapper.WebBrowser.LoadCompleted += (sender, args) => Execute.OnUIThread(() =>
                    {
                        HelpViewWrapper.CircularProgressBarVisibility = Visibility.Collapsed;
                        HelpViewWrapper.WebBrowserVisibility          = Visibility.Visible;
                    });
                    Execute.OnUIThread(() =>
                    {
                        HelpViewWrapper.Navigate(Uri);
                    });
                }
                else
                {
                    ResourcePath = FileHelper.GetFullPath(StringResources.Uri_Studio_PageNotAvailable);
                    Execute.OnUIThread(() =>
                    {
                        HelpViewWrapper.Navigate(ResourcePath);
                        HelpViewWrapper.CircularProgressBarVisibility = Visibility.Collapsed;
                        HelpViewWrapper.WebBrowserVisibility          = Visibility.Visible;
                    });
                }
                //});
            }
        }