Questions tagged [dispatcher]

In WPF and Silverlight, Dispatcher is an object that is used to execute work on a specific thread. In another meaning, dispatcher defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server.

In and , Dispatcher is an object that is used to execute work on a specific .

In another meaning, a dispatcher object can forward a client's request to a resource or include the resource itself in the response back to the client. A resource can be another servlet, or an HTML file, or a JSP file, etc.

1296 questions
0
votes
1 answer

WPF: When do I need to call Dispatcher.BeginInvoke

I know that Dispatcher.BeginInvoke is needed whenever I'm updating the GUI on a background thread. But how do I determine at runtime if it is needed?
Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447
0
votes
1 answer

Dispatcher.BeginInvoke Skips loading UI controls in Prism

I have a WPF application developed with Prism. I am facing a typical scenario for a code change I implemented for performance improvement. I have a UI Grid which shows a list of entities. I select some 10 entities in the Grid and try to open it,…
Darey
  • 497
  • 4
  • 24
0
votes
1 answer

Another Way to use Dispatcher.CheckAccess?

I am new to WPF. CODE 1: if (!Dispatcher.CheckAccess()) { if (ab == "abc") { Dispatcher.Invoke( () => lab1.Visibility = Visibility.Visible …
Antisan
  • 63
  • 1
  • 6
0
votes
2 answers

Alternative to Dispatcher class for .NET 2.0

I'm new to threading. While learning from WPF sample (A Wix Bootstrapper application), I've came across the use of System.Windows.Threading.Dispatcher in Run() method something like: MyDispatcher = Dispatcher.CurrentDispatcher; . . //rest of the…
0
votes
1 answer

Exception on casting Dispatcher Servlet

I have a maven web in eclipse and on compiling it, i am getting some exception saying java.lang.ClassCastException: org.springframework.web.servlet.DispatcherServlet cannot be cast to javax.servlet.Servlet I am not able to understand the exception…
Saumyaraj
  • 1,220
  • 3
  • 15
  • 37
0
votes
1 answer

How to stop DispatcherTimer from inside Try - Catch?

Please, help me to understand how I could stop attempts of executing MethodOne() inside a dispatcherTimer.Tick event handler of WPF DispatcherTimer after first unsuccessful attempt of doing it. TimeSpan ts = new TimeSpan(0, 0, 5); …
rem
  • 16,745
  • 37
  • 112
  • 180
0
votes
1 answer

Dispatcher thread infinite loop

I created a new window in a separate dispatcher Dispatcher dispatcher = null; var newWindowThread = new Thread(() => { MainWindow window = new MainWindow(); …
Vladimir Kruglov
  • 196
  • 1
  • 19
0
votes
2 answers

Threaded ticker control on top of Main thread control in wpf

I have requirement in which i need to show smooth scrolling text with some GIF Images and jpeg or mediaelement on a ticker. However, since this involves lot of CPU cycles for the main UI thread, i planned to create the ticker control on another…
Rahul W
  • 833
  • 11
  • 26
0
votes
1 answer

Progress bar not getting updated on WPF UI

I am using below code to show the progress bar status in WPF (MVVM) app which is basically on a thread however if I am putting on a dispatcher thread it's status not being updated on UI. With Thread: Main() { Thread LoadApp = new…
user2519971
  • 345
  • 3
  • 12
  • 27
0
votes
2 answers

node.js URL dispatching without hardcoding

I need a corporate website with several pages I've been able to produce that pages using below codes (using ECT template engine): var http = require('http'); var url = require('url'); var ECT = require('ect'); var renderer = ECT({ root : __dirname…
apasajja
  • 576
  • 2
  • 6
  • 20
0
votes
1 answer

pagecontext request dispatcher servlets

I am trying to forward a request using "RequestDispatcher". I have JSP pageContext object. I tried to forward my request to my servlet "MyServlet" using the following code. I set some attributes in my request and forwarded it. But i am not able to…
Kalidha
  • 21
  • 4
0
votes
1 answer

Bound items in extra thread not deletable from dispatcher thread

RefreshItems is called from the constructor of the ViewModel and when the user wishes it (RefreshCommand on button click). Delete is also bound to a DeleteCommand. I want to refresh the items within a new thread because of some animations which…
timmkrause
  • 3,367
  • 4
  • 32
  • 59
0
votes
1 answer

Load control throws The calling thread cannot access this object...

I have to load a XAML file, but since it function only in context of a STA thread, I have to start a new thread and set the apartment state of it to STA. After control is loaded I want to get all its logical children with…
Stefan Fachmann
  • 555
  • 1
  • 5
  • 18
0
votes
2 answers

UI not working after DispatcherTimer

After implementing DispatcherTimer, my application that involves user interaction do not work. For more information, I am trying to develop an application using leap motion. Need the timer work together with the UI for user to make some gestures and…
0
votes
1 answer

Dispatcher.Invoke to update UI Control

I have a .Net 4.0 class that has a custom event handler (StatusChanged). I am trying to consume this class via a thread. I don't have the luxury of using BackgroundWorker because libraries I use do not support multi thread apartment state. One of…
Tim C
  • 47
  • 1
  • 7