コード例 #1
0
 private void AppBarForward_Click(object sender, RoutedEventArgs e)
 {
     if (WVWebBrowser.CanGoForward)
     {
         WVWebBrowser.GoForward();
     }
 }
コード例 #2
0
        // WebView click events

        private void AppBarBack_Click(object sender, RoutedEventArgs e)
        {
            if (WVWebBrowser.CanGoBack)
            {
                WVWebBrowser.GoBack();
            }
        }
コード例 #3
0
        // Loads webview landing page after Idle time longer than this.timeout (+/- 1 minute)
        private async void ResetOnIdle()
        {
            // checks if idle time is longer than timeout and current Uri is not home
            if (timeout <= GetIdleTime() && uri != currentUri)
            {
                // loads landing page in webview
                WVWebBrowser.Navigate(new Uri(this.uri));
            }
            // waits 1 minute before re executing resetOnIdle();
            await Task.Delay(30000);

            ResetOnIdle();
        }
コード例 #4
0
 public MainPage()
 {
     // set timeout in milliseconds
     timeout = 300000;
     // set home uri
     uri = "https://www.wikipedia.org";
     // set regex for validUri's
     validUrl = new Regex(@"^https:\/\/(([a-zA-Z0-9\-\\_\.]*)\.|)wikipedia.org(\/.*|)$"); // all https sites, domains and sub-domains of wikipedia.org
     InitializeComponent();
     WVWebBrowser.Navigate(new Uri(uri));
     // setting current uri
     currentUri = uri;
     WVWebBrowser.NavigationStarting += WVWebBrowser_NavigationStarting;
     // Initializes the reset scheduler
     ResetOnIdle();
 }
コード例 #5
0
 private void AppBarRefresh_Click(Object sender, RoutedEventArgs e)
 {
     WVWebBrowser.Refresh();
 }
コード例 #6
0
 private void AppBarHome_Click(Object sender, RoutedEventArgs e)
 {
     WVWebBrowser.Navigate(new Uri(this.uri));
 }
コード例 #7
0
 public WebPageView()
 {
     this.InitializeComponent();
     WVWebBrowser.Navigate(new Uri("http://www.google.com"));
 }