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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:21:25+00:00 2026-05-27T16:21:25+00:00

In my application I realized a custom statusbar control. It has progressbar, statusTextBox etc.

  • 0

In my application I realized a custom statusbar control. It has progressbar, statusTextBox etc. Other modules could get the instance of that class with MEF, and bind their data in his elements with methods and properties. The problem is that the View of my statusbar updates only after some operation has finished.
Here is a code example:

[ImportingConstructor]
public IconManagerModel(IStatusBar statusBar)
{
    StatusBar = statusBar;
}

public void SomeMethod()
{    
    for(...)
    {
        //I tried to use Dispatcher but it didn't help. View updates after method has finished
        Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Normal,  
            delegate()
            {
                StatusBar.SetProgress(amountComleted,total)
            }
        );

        // ...
    }
}

Thanx

  • 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-27T16:21:26+00:00Added an answer on May 27, 2026 at 4:21 pm

    You want to run SomeMethod() on another thread, then call back onto the Dispatcher to update the progress. Really, if the custom progress bar is hooked up to some UI element, then the implementation should handle the calling back onto the UI thread.

    You may want something a little like:

    public IconManagerModel(IStatusBar statusBar)
    {
        StatusBar = statusBar;
    
        var thread = new Thread(new ThreadStart(SomeMethod));
        thread.Start();
    }
    

    SomeMethod() will now be running on a different thread, so if you update the progress on the UI thread then you should see the results you desire.

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

Sidebar

Related Questions

I have encountered a problem in my application and realized that I could fix
I've creating a Java Swing application and I realized that I have many many
I am creating a simple application with Django. I realized that I am doing
From an application I need to develop, I've received a specific font that has
I have a Java application that I've been working on and I just realized
I have WPF application. After testing my app on Windows7 and realized that opening
I am cleaning up my iphone application and, in doing so, realized that i
I'm writing a web application that's supposed to be embedded in other people's websites
I realized that any application which uses hibernate, fails to undeploy completely in Glassfish
I have an asp.net application and I've realized, that if I set ValidateRequest to

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.