We help IT Professionals succeed at work.
Get Started

thread requesting invalidate on ui thread c#

Last Modified: 2015-07-23
hi experts,
I have a thread that is moving objects around in a canvas by changing their coordinates when events happen.  normally if I was doing all this on the ui thread, there's no problem to call invalidate whenever I want to redraw.  but of course this blows up from the thread if invalidate is called from it.

could someone show me a little snippet that would show how to use the synchronization context to call invalidate from my thread?  this worker was started with task.factory.startnew(MoveObjectsAround)

Watch Question
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE