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

stop current thread until input is received from another window wpf C#

I want to stop other Threads until the user provides input in this window... giving code that I have as such: if (!File.Exists(@"DiscoveryConfig.bin")) { Application.Current.Dispatcher.Invoke((showRangeInputWindow)delegate() { new…
AZ_
  • 21,688
  • 25
  • 143
  • 191
0
votes
3 answers

Dispatcher.Invoke hangs main window

I've created new WPF project, in main window I'm doing: public MainWindow() { InitializeComponent(); Thread Worker = new Thread(delegate(){ this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action(delegate { …
Taras
  • 1,118
  • 2
  • 12
  • 19
0
votes
2 answers

no definition for dispatcher

I'm getting the error 'socketServer.Form1' does not contain a definition for 'Dispatcher' and no extension method 'Dispatcher' accepting a first argument of type 'socketServer.Form1' could be found From private void tbAux_SelectionChanged(object…
Kermit
  • 33,827
  • 13
  • 85
  • 121
0
votes
1 answer

Flex - Parsley - Event Will Not Dispatch From Method in Result Handler

I have a Command that executes a service call. In the result handler, I am doing some logic based off the result data. If the logic meets specific criteria, I am displaying a confirmation popup. If the user clicks the continue button in the…
anad2312
  • 787
  • 2
  • 8
  • 20
0
votes
2 answers

c# wpf Updating UI source from BlockingCollection with Dispatcher

Here's my problem. I'm loading a few BitmapImages in a BlockingCollection public void blockingProducer(BitmapImage imgBSource) { if (!collection.IsAddingCompleted) collection.Add(imgBSource); } the loading happens in…
Probst
  • 17
  • 1
  • 8
0
votes
1 answer

How to get screen resolution for WinPhone 8 from a background thread

I'm creating a library. One thing that we need is the screen resolution of the phone in pixels(width by height) We were using this method successfully Screen.Width = (int) System.Windows.Application.Current.Host.Content.ActualWidth; Screen.Height =…
Earlz
  • 62,085
  • 98
  • 303
  • 499
0
votes
1 answer

Backgroundworker calling Dispatcher.Invoke

I am working on this code written by some others. It contains a background worker which from its DoWork calls a Dispatcher.Invoke. My problem is that i think my BackgroundWorkerCompleted will happen before my Dispatcher.Invoke is done. Is that…
Jepzen
  • 2,942
  • 6
  • 40
  • 62
0
votes
1 answer

Dispatcher.Invoke working in vs2010 but giving error in vs2008

I have to submit my WPF project tomorrow morning; it is running perfectly in VS 2010 but giving error in VS 2008 (.NET 3.5 in both case) using C#. I am using a timer using Dispatcher.Invoke but in VS 2008 it is giving error : Error 163 The best…
Nidhi Sharma
  • 135
  • 1
  • 2
  • 12
0
votes
1 answer

RequestDispatcher: Servlet mapping doesn't work properly

Its so confusing. Don't have any kind of idea what happend here: I want to deploy a simple WAR-project. Two HttpServlets, one just forwards the request to another one: ... String[] selectedOptionsLabels = ... req.setAttribute("checkedLabels",…
John Rumpel
  • 4,535
  • 5
  • 34
  • 48
0
votes
1 answer

Updating WPF Model using dispatcher

I have a Visual3D object loaded from a file and displaying on screen. That works fine. I am trying to rotate it from data received in a SerialDataReceivedEventHandler - which also works fine. When I try to rotate the model, it throws an…
toadzky
  • 3,806
  • 1
  • 15
  • 26
0
votes
1 answer

Getting wrong results from a Thread

I have a small WPF application that needs to enumerate through all files in a specified directory and check if a certain string exists in it. this is the search method: private void btnSearch_Click_1(object sender, RoutedEventArgs e) { Thread t =…
Yoav
  • 3,326
  • 3
  • 32
  • 73
0
votes
1 answer

Dispatcher not making a new thread

First, sorry for my english. I'm making a WPF/C# application, with a Frame and pages. When I try to change quickly the page displayed, by 4 or 5 times, the program starts to freeze and I need to wait. I'm forced to use a Dispatcher to make the pages…
Guilherme
  • 5,143
  • 5
  • 39
  • 60
0
votes
1 answer

windows store correct way of getting dispatcher, async

I'm currently looking into both windows store apps & wp8 apps, both being sl and c# projects. Fetching the dispatcher is different from wpf, and I'm a bit pussled as the one in Window.Current seems to disappear in some of my async methods. All I…
0
votes
1 answer

Get multiple attributes from servlet/s to same JSP

I have a problem getting multiple attributes in a JSP page (one jsp-page) from two different servlets. I'm getting an exception because when the JSP loads, both of the request.getAttribute() are executed, and one of them have not yet been "sent"…
user2099024
  • 1,452
  • 4
  • 16
  • 26
0
votes
1 answer

Invalid Cross thread access WP7

I am using Matrix xmppClient to set up a chat client app on WP7.. On giving wrong credentials (username/password), Invalid Cross thread access exception is been thrown...I am using Dipatcher.BeginInvoke as shown below but still that exception is…
Deepak
  • 21
  • 1
  • 8