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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:25:30+00:00 2026-05-20T15:25:30+00:00

I’m developing a twitter application for Windows Phone 7 and have been doing some

  • 0

I’m developing a twitter application for Windows Phone 7 and have been doing some prototyping. I have come across a problem when minipulating some objects on the application. The below code just hangs (nothing moves and the search doesn’t update) unless I comment out Dispatcher.BeginInvoke(new ThreadStart (doProgressBar)); I have also tried using a background worker thread to run doProgressBar() but with the same effect. Sticking a breakpoint in shows that it does hit doProgressBar() and that seems to be working correctly.

Any help helping me understand what’s wrong would be appreciated. I don’t see why I don’t at least see the progress bar update. I’m also really confused why the main thread would hang when something is running in another thread. Possibly there is something about threading in a mobile application I need to understand?

    public MainPage()
    {
        InitializeComponent();
    }

    private void ProcessIncommingSearch(TwitterSearchResult searchResult, TwitterResponse response)
    {
        if (response.StatusCode == HttpStatusCode.OK)
        {
            foreach (var status in searchResult.Statuses)
            {
                TwitterStatus inline = status;
                Tweet tweet = new Tweet(inline);
                Dispatcher.BeginInvoke(() => lboxTweets.Items.Add(tweet));
            }
        }
    }

    private void image1_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
    {
        Dispatcher.BeginInvoke(() => lboxTweets.Items.Clear());
        Dispatcher.BeginInvoke(new ThreadStart (doProgressBar));
        TwitterService ts = GlobalVariables.Service();
        ts.Search(txtSearch.Text, ProcessIncommingSearch);
    }

    private void doProgressBar()
    {
        while (progressBar1.Value <= 100)
        {
            progressBar1.Value += 1;
        }
    }

    private void txtSearch_GotFocus(object sender, RoutedEventArgs e)
    {
        txtSearch.Text = "";
    }

    private void txtPage_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
    {
        throw new NotImplementedException();
    }
  • 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-20T15:25:31+00:00Added an answer on May 20, 2026 at 3:25 pm

    I’m having a little difficulty understanding your code here, but when you call Dispatcher.BeginInvoke(new ThreadStart (doProgressBar)); it looks like you are invoking a new thread from the UI thread. That means that doProgressBar actually isn’t running on the UI thread, so you probably won’t see any updates to it until after it completes and the UI thread triggers an update.

    Also, your code will just spin from progressBar.Value to a hundred in record time, possibly faster than you would be able to see it update.

    Also, you mention commenting out Dispatcher.BeginInvoke(() => doProgressBar()); — I don’t see this anywhere in your code. Are you sure you posted the right version?

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put

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.