title: .NET Executing function in main thread(UI) from other thread
body: <p>My application receive some commands from h/w devices in a Thread other than Main(UI) thread.</p>
  
  <pre><code>// start receiver-thread
  m_recThread = new Thread(RecThread) { Name = "RS" };
  </code></pre>
  
  <p>from this thread i want to do some action on the UI Theraad. say one button click!!! i am using </p>
  
  <pre><code>Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, 
    new Action&lt;Vote&gt;(StartThisVote), presidentvote);
  </code></pre>
  
  <p>but this didnot worked. please let me know who can execute a Command in Main Thread(UI) from this background thread. </p>