コード例 #1
0
        protected virtual async void RequestNavigation(string url)
#endif
        {
            if (NavigationRequested != null)
            {
                var eventArgs = new NavigationRequestEventArgs(url);
                NavigationRequested(this, eventArgs);
                if (eventArgs.Cancel) return;
            }

            if (!string.IsNullOrEmpty(url))
            {
#if WINDOWS_PHONE 
                WebBrowserTask task = new WebBrowserTask(); 
                task.Uri = new Uri(url); 
                task.Show(); 
#elif SILVERLIGHT
                HtmlPage.Window.Navigate(new Uri(url), "_blank");
#elif NETFX_CORE
                await Launcher.LaunchUriAsync(new Uri(url));
#endif
            }
        }
コード例 #2
0
 void controller_NavigationRequest(object sender, NavigationRequestEventArgs e)
 {
     RequestNavigation(e.Url);
 }