Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of a Dispatcher Object in WPF?

Tags:

wpf

dispatcher

What is the use of a Dispatcher Object in WPF?


1 Answers

Almost every WPF element has thread affinity. This means that access to such an element should be made only from the thread that created the element. In order to do so, every element that requires thread affinity is derived, eventually, from DispatcherObject class. This class provides a property named Dispatcher that returns the Dispatcher object associated with the WPF element.

The Dispatcher class is used to perform work on its attached thread. It has a queue of work items and it is in charge of executing the work items on the dispatcher thread.

You can find on the following link some more details on the subject: https://www.codeproject.com/Articles/101423/WPF-Inside-Out-Dispatcher

like image 126
3 revs, 3 users 86%arik Avatar answered Sep 15 '25 15:09

3 revs, 3 users 86%arik