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

  • Home
  • SEARCH
  • 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 6795211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:18:59+00:00 2026-05-26T18:18:59+00:00

I am new to WPF and have a question regarding dispatcher and Delegate.Invoke .

  • 0

I am new to WPF and have a question regarding dispatcher and Delegate.Invoke.

In a windows forms application, we can use the invoke method to make changes to UI controls from other threads. This works because invoke “executes the specified delegate on the thread that owns the control’s underlying window handle” (as per msdn).

My question is:

  1. Why doesn’t Invoke work on WPF? It should be allowed to make changes to UI as the thread that owns the UI control gets to execute the delegate, but still it throws a runtime exception that “a thread is trying to modify an object that is owned by a different thread”.

  2. How does the dispatcher manage to make changes to WPF controls while Invoke fails?

  3. Is it possible to do cross thread programming in WPF without using dispatcher or background worker?

  • 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-26T18:18:59+00:00Added an answer on May 26, 2026 at 6:18 pm

    1) why doesn’t invoke work on wpf?

    It works fine, but perhaps you’re not using it correctly. I suggest you read the documentation

    It should be allowed to make changes to UI as the thread that owns the UI control gets to execute the delegate, but still it throws a runtime exception that “a thread is trying to modify an object that is owned by a different thread”

    Perhaps you created a UI object on a worker thread, then tried to add it to the main UI on the UI thread ? Without seeing your code, it’s only a guess…

    2)How does despatcher manage to make changes to wpf controls while invoke fails?

    This question is not very clear, but it’s probably related to the first question anyway…

    3) Is it possible to do cross thread programming in wpf without using despatcher or background worker?

    If you need to manipulate the UI from a worker thread, you have to use the dispatcher. BackgroundWorker also uses the dispatcher (indirectly, through the ISynchronizationContext interface) to raise events on the UI thread. There’s no way around it.

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

Sidebar

Related Questions

I am (very) new to WPF and I have got a question regarding that.
Hi, I'm new to both Prism and WPF, and I have a question regarding
I'm rather new to WPF, so maybe this is a simple question. I have
I have window form in my WPF Application when I open new window from
i am new to WPF and i have one question(the first one actually, more
Greetings all, I have a question. I have created a WPF application. So, I
This is probably a basic question, since I'm new to WPF.. I have a
Background/context for this question: I have a WPF desktop application. It uses LINQ to
I'm relatively new to VB.NET and WPF and I have a basic threading question.
I have a question regarding the MVVM design for C#/WPF. I've had a look

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.