private void LaunchURLButton_Click(object sender, RoutedEventArgs e)
        {
            // Check to make sure this is not a file path
            if (!Application.Current.IsRunningOutOfBrowser && Application.Current.Host.Source.Scheme == "file")
            {
                ApplicationEx.Instance.DisplayMessageBox("Due to Silverlight's security restrictions, you cannot launch a URL in a browser window when the application is running from a file path. When the application is launched from a URL (as should be the case in production scenarios), this functionality will start to work.", "expanz");
            }
            else
            {
                try
                {
                    string openUrl = URL;

                    if (_contentType == Common.ContentTypes.EmailAddress)
                    {
                        openUrl = "mailto:" + openUrl;
                    }

                    HyperlinkButtonWrapper hlbw = new HyperlinkButtonWrapper();
                    hlbw.OpenURL(openUrl);
                }
                catch (Exception ex)
                {
                    ApplicationEx.Instance.DisplayMessageBox(ex.Message, "expanz");
                }
            }
        }
예제 #2
0
        public static void OpenURL(Uri navigateUri, String target = "_blank")
        {
            HyperlinkButtonWrapper hlbw = new HyperlinkButtonWrapper();

            hlbw.OpenURL(navigateUri, target);
        }
예제 #3
0
		public static void OpenURL(Uri navigateUri, String target = "_blank") {
			HyperlinkButtonWrapper hlbw = new HyperlinkButtonWrapper();
			hlbw.OpenURL(navigateUri, target);
		}
        private void LaunchURLButton_Click(object sender, RoutedEventArgs e)
        {
            // Check to make sure this is not a file path
            if (!Application.Current.IsRunningOutOfBrowser && Application.Current.Host.Source.Scheme == "file")
            {
                ApplicationEx.Instance.DisplayMessageBox("Due to Silverlight's security restrictions, you cannot launch a URL in a browser window when the application is running from a file path. When the application is launched from a URL (as should be the case in production scenarios), this functionality will start to work.", "expanz");
            }
            else
            {
                try
                {
                    string openUrl = URL;

                    if (_contentType == Common.ContentTypes.EmailAddress)
                        openUrl = "mailto:" + openUrl;

                    HyperlinkButtonWrapper hlbw = new HyperlinkButtonWrapper();
                    hlbw.OpenURL(openUrl);
                }
                catch (Exception ex)
                {
                    ApplicationEx.Instance.DisplayMessageBox(ex.Message, "expanz");
                }
            }
        }