示例#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
文件: BasePage.cs 项目: Oman/Maleos
 protected void OnNavigationRequest(NavigationRequestEventArgs args)
 {
     if (NavigationRequest != null)
     {
         NavigationRequest(this, args);
     }
 }
示例#3
0
 void controller_NavigationRequest(object sender, NavigationRequestEventArgs e)
 {
     RequestNavigation(e.Url);
 }