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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:02:35+00:00 2026-05-12T14:02:35+00:00

We have a silverlight application which uses a dispatcher and I would appreciate any

  • 0

We have a silverlight application which uses a dispatcher and I would appreciate any help explaining what the following codes does? (unfortunately the developer who wrote the code has left).

So what we have is the following:

public class ABC
{
    private Dispatcher dispatcher;
    private Thread threadRunner;

    public void ABC()
    {
       threadRunner= new Thread(ThreadRunnerMethod)
                         {
                           IsBackground = true, 
                           ApartmentState = ApartmentState.STA
                         };
       threadRunner.Start();
    }

    private static void ThreadRunnerMethod()
    {
       Dispatcher.Run();
    }


    public void MainMethod()
    {
       dispatcher = Dispatcher.FromThread(threadRunner);
       dispatcher.Invoke(new Action(() => 
                                     // "DO SOME WORK WITH A COM OBJECT"
                                      ));

    }
}

I have some basic experience with threading but I have no idea how this all works?

JD

  • 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-12T14:02:36+00:00Added an answer on May 12, 2026 at 2:02 pm

    It’s the equivalent of Control.Invoke in Windows Forms, basically – it’s just been separated into its own object.

    As I understand it, Dispatcher.Run will basically start an event loop, and you can marshall calls into that event loop using Dispatcher.Invoke. Dispatcher.FromThread finds the Dispatcher object which is responsible for a given thread – so in this case, it finds the event loop running in the new thread.

    So in your code, the delegate created with the lambda expression will execute in the newly created thread.

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

Sidebar

Related Questions

I have a Silverlight application in which I would like to call a WCF
I have silverlight 2.0 application and which uses WCF service to get data and
I have a Silverlight application which uses 2 separate databases. I have a situation
I have an ASP MVC application which uses some silverlight applications in the View.
I have an MVC application which uses a silverlight control. Somewhere along the line
Background Currently I have a C# Silverlight business application which uses RIA Services. The
Background Currently I have a C# Silverlight business application which uses RIA Services. The
I have a Silverlight 4 application which uses the MVVM pattern. I have: 1.
I have a Silverlight application which has on it a Canvas. On that Canvas,
I have a silverlight application which reads data from a db and displays them

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.