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 7663575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:05:16+00:00 2026-05-31T14:05:16+00:00

Really really odd problem, in short, I’m doing a foreach over every word in

  • 0

Really really odd problem, in short, I’m doing a foreach over every word in a textblock, if that word starts with for example “@” I want to make a username hyperlink out of it. However in about 70% of the cases it replaces the text fine, but it just doesn’t become a hyperlink.

Partial code:

private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
    var kaas = Tweet.Split(' ');
    foreach (string a in kaas)
    {
        if (a.StartsWith("@"))
        {
            Hyperlink uname = new Hyperlink();
            uname.NavigateUri = new Uri("http://twitter.com/" + "xarinatan");
            uname.RequestNavigate += new RequestNavigateEventHandler(Hyperlink_RequestNavigateEvent);
            uname.Inlines.Add("ASDAS");
            TweetBlock.Inlines.Add(uname);
            //TweetBlock.Inlines.Add(Username(a));
            TweetBlock.Inlines.Add(" ");
        }
    }
}

Above code turns all instances that start with “@” into “ASDAS” but fails most of the time to properly convert it to a hyperlink, HOWEVER it DOES convert it SOMETIMES.
It’s completely beyond me how it only works sometimes, instead of all the time or not at all.

All suggestions are welcome!

edit: To clarify, it -always- replaces the text with ‘ASDAS’, but in 70% of the cases it doesn’t become a hyperlink.

  • 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-05-31T14:05:17+00:00Added an answer on May 31, 2026 at 2:05 pm

    My friend found the answer. Somehow inlines being added as string causes sporadic behavior, they have to be added as a ‘Run’.

    Fix can be found here: https://github.com/zahndy/o3o/commit/68b50f8c0ea106bcc709d3f69658b28da9c8a9d4#diff-3

    Thanks all for the suggestions!

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

Sidebar

Related Questions

I'm having a really odd problem (which usually means I'm doing something wrong) with
I am having a really odd problem with Flash CS4. I have a MovieClip
Ok, this might be a really odd problem. I am writing a web application,
I've got a really odd error message that only occurs when I add the
I've got a really odd issue that I've not had any success googling for.
This is a really odd situation that I can't seem to work out where
I have an extremely odd problem in my JUnit tests that I just can't
I have a really odd problem. I am using an upload form to upload
I've got this odd problem. If I make a call on that function through
I've got a really odd problem when building a project in VS2008. Having made

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.