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
7
votes
3 answers

Dispatcher is not coming on C# Windows Forms Application

I have a C# Windows Forms Application with a progress bar. I want to progress that dynamically based on some method status. I have that method in a separate class, and am creating a new thread for that method, with a delegate to pass the status of…
Kishor
  • 4,006
  • 7
  • 30
  • 47
7
votes
1 answer

Cancel BeginInvoke in WPF

In WPF, I am calling This.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, mydelegete); Is there a way to cancel later that BeginInvoke method? Thanks
Ghassan Karwchan
  • 3,355
  • 7
  • 37
  • 65
7
votes
3 answers

Cannot use a DependencyObject that belongs to a different thread than its parent Freezable

WPF - I'm using BackgroundWorker to create a Model3D object, but when I want to add it to a Model3DGroup that is defined in the XAML, I get exception: Cannot use a DependencyObject that belongs to a different thread than its parent Freezable. This…
Erez
  • 6,405
  • 14
  • 70
  • 124
6
votes
3 answers

C++ Factory Pattern with Heterogenous Constructor Constraint

I'm implementing a C++ program that can programmatically instantiate objects given an input file which provides the class names and arguments to pass to the constructors. The classes are derived from a common base class but their constructor…
Salman Haq
  • 340
  • 3
  • 11
6
votes
1 answer

Help with Dispatcher.BeginInvoke

I am trying to call a method that started on a background thread on the UI thread calling BeginInvoke and passing in a delegate as follows: Dispatcher.BeginInvoke(Function() UpdateApplicationDataUI()) to call this method: Private Sub…
Matthew Pitts
  • 809
  • 1
  • 8
  • 13
6
votes
2 answers

How to set Image.Source property with Dispatcher?

I tried use this recomendations: http://msdn.microsoft.com/en-us/library/ms741870.aspx ("Handling a Blocking Operation with a Background Thread"). This is my code: public partial class MainWindow : Window { public MainWindow() …
Maxim Kamalov
  • 745
  • 9
  • 23
6
votes
3 answers

.NET Dispatcher class missing (System.Windows.Threading)

I read about the Dispatcher class in .NET. But curiously the System.Windows.Threading namespace does not exist in my case (MSDN). Do I get something wrong? Thanks for your help.
iDog
  • 361
  • 1
  • 3
  • 13
6
votes
1 answer

WPF Dispatcher.InvokeAsync() strange behavior with async delegate

If you have an async method, like the one below: private async Task DoAsync() { Console.WriteLine(@"(1.1)"); Thread.Sleep(200); Console.WriteLine(@"(1.2)"); await Task.Delay(1000); …
Maciek Świszczowski
  • 1,155
  • 11
  • 28
6
votes
1 answer

Create Akka Dispatcher programmatically

I have a scenario where I create actors on demand. I want to be able to define a Dispatcher and attach it to my actor programmatically. The deal is: My ActorSystem is already running, which mean that it have already loaded all the Akka…
Barbara
  • 213
  • 2
  • 9
6
votes
1 answer

How can I test a class that uses DispatcherTimer?

I've found a couple of Stack Overflow questions along with a couple of blog posts that already touch on this topic, but unfortunately none of them are meeting my needs. I'll just start with some sample code to show what I'd like to accomplish. using…
soapergem
  • 9,263
  • 18
  • 96
  • 152
6
votes
4 answers

How Dispatcher differs from the background thread?

How does the Dispatcher concept in .NET 3.5 and WPF differ from the background thread in .NET 2.0 ? For example what will be difference between statements below: delegate.Invoke/BeginInvoke AND this.dispatcher.Invoke/BeginInvoke
Ashish Ashu
  • 14,169
  • 37
  • 86
  • 117
6
votes
4 answers

RequestMappingHandlerMapping.getHandlerInternal:230 - Did not find handler method for

trying to make some spring example program - constantly getting the error - it happens that my controller cannot handle /hello request. Here is debug info from log4j. 13:50:58,502 {TRACE} DispatcherServlet.initContextHolders:1018 - Bound request…
DENMROOT
  • 61
  • 1
  • 1
  • 4
6
votes
2 answers

How to invoke WPF Dispatcher in Nunit?

I want to test an application which renders a text block with a data field value. I would like to get the actual width and actual height, once the rendering completes. Everything works fine. The problem came first, when I tried to test the…
Prince Ashitaka
  • 8,623
  • 12
  • 48
  • 71
6
votes
4 answers

Is it considered bad practice to have ViewModel objects hold the Dispatcher?

My WPF application is structured using the MVVM pattern. The ViewModels will communicate asynchronously with a server, and when the requested data is returned a callback in the ViewModel is triggered, and it will do something with this data. This…
stiank81
  • 25,418
  • 43
  • 131
  • 202
6
votes
1 answer

Javascript dispatchEvent

I'm using Flash a lot and my classes uses EventDispatcher class which allows me to define custom events of a class. How can I do this in JavaScript. I would like to do something like this: var MyClass = function() { }; MyClass.prototype = { test :…
xpepermint
  • 35,055
  • 30
  • 109
  • 163