Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:19:18+00:00 2026-06-03T16:19:18+00:00

In my Windows phone application I use RichTextBox element I have a hyperlink on

  • 0

In my Windows phone application I use RichTextBox element

I have a hyperlink on it, and when user click on it there is a dialog: Do you want to open this link in exteranl browser. If user say no, external browser shouldn’t be opened. I cancel navigation but in any case – external browser opens. How can I cancel opening link in browser?

//Constructor
        static Helper()
                {
                    var phoneApplicationFrame = Application.Current.RootVisual as PhoneApplicationFrame;
                    if (Application.Current.RootVisual as PhoneApplicationFrame != null)
                    {
                        phoneApplicationFrame.Navigating += new NavigatingCancelEventHandler(NavigationService_Navigating);
                    }

                }

link.Foreground = new SolidColorBrush(Colors.Blue);
                            link.MouseOverForeground = new SolidColorBrush(Colors.Blue);
                            link.TargetName = "_blank";

                            var linkText = new Run() { Text = linkDesc };
                            link.Inlines.Add(linkText);
                            link.Click += new RoutedEventHandler(NavidateTo);

private static void NavidateTo(object sender, RoutedEventArgs routedEventArgs)
        {

            if (MessageBox.Show(
                             Constants.BrowserNavigating,
                             "",
                              MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
            {
                StateManager.Set("ExternalBrowser", "true");
            }
            else
            {
                StateManager.Set("Browser", "true");
            }
        }

        public static void NavigationService_Navigating(object sender, NavigatingCancelEventArgs e)
        {
            var res = StateManager.Get("ExternalBrowser");
            if (res != null)
            {
                StateManager.Remove("ExternalBrowser");
                e.Cancel = true;
            }

        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:19:20+00:00Added an answer on June 3, 2026 at 4:19 pm

    Rather than have the HyperlinkButton open the link itself, don’t specify the NavigationUri but handle the Tap event yourself.

    In the eventhandler ask the question and only open the browser if they say yes.
    This will be much simpler than trying to cancel something that is already in progress.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Windows Phone 7 application built in Silverlight. This application makes use
I'm developing a Windows Phone application . I have defined this on App.xaml: <nav:UriMapping
I have to use many different images into my windows phone application. Although I
i am trying to use the Google APIS in developing a Windows Phone application,
I use json-rpc client from json-rpc.net in my windows phone application. Code: var client
Can someone explain how to use JSON-RPC.net in my application for windows phone. When
I am developing a Windows Phone Application and from this application I am accessing
iHi, in my Windows Phone application in View I have: <TextBlock x:Name=lblink FontSize=15 Margin=30,0,24,0
Thanks in advance.. I have a windows phone application. In that I am showing
All, I have a basic Windows 7 Phone application and I have just finished

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.