hello ,
i am new to c# . i want to know what is happening in this code below. I am working in visual studio platform.
this.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)(() => this.ProcessDepthData()));
thank you
Loading

VulpesPosted Dec 20, 2014, 11:16 AM
However, as the updating can only take place on the UI thread, you're not going to be able to update three images concurrently even if the images are created on separate background threads. You'll only be able to update them consecutively though if they display very quickly this shouldn't be a problem.
Sanju SinghPosted Dec 19, 2014, 11:36 PM
well, how is this code different from creating a background thread and asking it to execute the desired method ? what i want to achieve is to update three bitmap images on my display window; in parallel .
yes i am capturing data from kinect sensors.If you have anything to through more light on this , please share.it will be of great help to me. thanks
VulpesPosted Dec 19, 2014, 10:56 AM
dinesh kumarPosted Dec 19, 2014, 7:04 AM
The Dispatcher maintains a prioritized queue of work items for a specific thread.
When a Dispatcher is created on a thread, it becomes the only Dispatcher that can be associated with the thread, even if the Dispatcher is shut down.
Executes the specified delegate asynchronously at the specified priority on the thread the Dispatcher is associated with. in this case the priority is in Background level so the methods which is called inside the Action() => delegate will be executed and there are many DispatcherPriority available in MSDN which would help you understand more in detail.
hope it helps.