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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:03:59+00:00 2026-05-30T19:03:59+00:00

I have a label and canvas representing a coordinate system. In the canvas there

  • 0

I have a label and canvas representing a coordinate system. In the canvas there is a node, which should change it’s place every time a calculation is made. This is done until a specific stopping criteria is meet.

I also have a label containing coordinate info for the note. I want to be able to see the node and label update on every iteration(every time the calculation is made).

I have looked a the dispatcher, but my GUI will only update when the calculations are done. Below is what I have tried doing with the Dispatcher for the label.

While(notDone = true){
//Calculations made here

Application.Current.Dispatcher.BeginInvoke(
                    DispatcherPriority.Background,
                    new Action(() => this.aLabel.Text = aString ));
}

I have been looking at solutions for similar problems and some solutions involve threads. Do I have to use threads to update my GUI?

  • 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-30T19:04:00+00:00Added an answer on May 30, 2026 at 7:04 pm

    Just create delegate and event for handling information changes

    public delegate void SomeInfoChangeDelegate(object o);
    public event SomeInfoChangeDelegate InfoChangeEvent = null;
    

    Assign listener to event and start thread w/ calculations

    InfoChangeEvent += new SomeInfoChangeDelegate(OnInfoChanged);
    Thread t = new Thread(new ParameterizedThreadStart(SomeWorkerThread));
    t.Start();
    

    Make calculation thread and event listener

        void OnInfoChanged(object o)
        {
            // Update label
        }
    
        protected void SomeWorkerThread(object o)
        {
            int i = 0;
            while(true)
            {
                if( i % 10 == 0 )
                {
                    if(InfoChangeEvent != null)
                    {
                        InfoChangeEvent(i);
                    }
                }
                Thread.Sleep(1000);
                i++;
            }
        }
    

    And don’t forget to stop thread 🙂

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

Sidebar

Related Questions

I have a TabControl which looks like this: <TabControl> <TabItem> <TabItem.Header> <StackPanel Orientation=Horizontal> <Canvas
I have some custom A panels on a canvas, where there a also B
I have Labels inside a Canvas, I need to get the label that intersects
I have Buttons which I have rotated vertically within a Canvas, that is working
I have a label function like : private function formatDate (item:Object, column:DataGridColumn):String { var
I have this label control in my web page <asp:Label ID=Label1 runat=server Text=test></asp:Label> And
i have a label in my form, and im trying to get the value
I have a Label, whose content is displayed by a while loop. when i
I have a label that is sometimes empty. How do I set up a
I have one label field and three buttons with the name of red, yellow,

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.