question

SINGHAmit-1801 avatar image
0 Votes"
SINGHAmit-1801 asked HuiLiu-MSFT commented

WPF - Architecture

Hi Team,

I have read in the wpf architecture post, stating that "Most objects in WPF derive from DispatcherObject"

https://docs.microsoft.com/en-us/dotnet/desktop/wpf/advanced/wpf-architecture?view=netframeworkdesktop-4.8

It is most of the objects, means not all objects , so which/what kind of objects will not use the DispatcherObject.

Thanks
Amit Singh

windows-wpfdotnet-wpf-xaml
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HuiLiu-MSFT avatar image
1 Vote"
HuiLiu-MSFT answered HuiLiu-MSFT commented

You could find objects that do not inherit from DispatcherObject here. Such as DispatcherEventArgs, DispatcherExtensions, Dispatcher, etc.
Update:
The following figure shows some of the main classes in the framework of the WPF class hierarchy (not all classes are included), which is helpful for a comprehensive understanding of the class hierarchy. The Brushes class in PresentationCore does not use DispatcherObject. It Implements a set of predefined SolidColorBrush objects.
132981-2.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



2.png (118.3 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the reply,

Well I get that, but System.Windows.Threading is related to c#, what I meant is, all wpf elements as we know Window, button or textbox inherits from DispatcherObject, so what the author meant by the document "Most objects in WPF derive from DispatcherObject" is System.Windows.Threading is also wpf object ?

So if we about wpf architecture only, is there anything available in Presentation Framework , Presentation Core that doesn't use the DispatcherObject?

Thanks

0 Votes 0 ·
HuiLiu-MSFT avatar image HuiLiu-MSFT SINGHAmit-1801 ·

Hi,@SINGHAmit-1801.I updated my answer, you can check the update in the answer.

1 Vote 1 ·
Castorix31 avatar image
0 Votes"
Castorix31 answered Castorix31 published

It is most of the objects, means not all objects , so which/what kind of objects will not use the DispatcherObject.

You can see the Hierarchy, from WPF Dispatcher - Introduction and How to use? :

or from "Windows Presentation Foundation Unleashed" :

03fig09.jpg



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.