Monday, September 8, 2014

WPF Architecture



WPF architecture is multilayered architecture.  It has three layers mainly Managed code, Unmanaged code and  Core Operating system. We can call these layers as set of assemblies that built up the entire framework.



The major components are below Presentation Framework, Presentation Core and Media Integration(Milcore)  are the major components of wpf architecture. 

 




Milcore is written in unmanaged code in order to enable integration with DirectX
DirectX engine is responsible for all display in WPF, allowing for efficient hardware and software rendering. And CLR Provides control over memory and execution.  The Composition engine in milcore is extremely very good in performance and required giving up many advantages of the CLR to gain performance.

Managed Layer: Managed layer of WPF is built using number of assemblies. These assemblies build up the WPF framework, and communicate with lower level unmanaged API to render its content.
   Few Assemblies in WPF Framework are 
1.       PresentationFramework.dll: It creates the top level elements like layout panels(Canvas,Grid,StackPanel,etc), Controls, Windows, styles etc.

2.       PresentationCore.dll:  It holds base types such as UIElement, Visual from which all shapes and controls are derived in PresentaitonFramework.dll.

3 . WindowBase.dll: They hold even more basic elements which are capable of being used outside the WPF environment like Dispatcher.

Unmanaged Layer(milcore.dll):
We can call this unmanaged layer as Media Integration Library Core which translates the WPF higher level object like layout panels, buttons, animation, etc using Direct3D rendering engine of WPF.

WindowsCodecs.dll: This is low level API which gives imaging support in WPF applications.  

WindowsCodes.dll: consists of a number of codecs which encode/decode images into vector graphics which will rendered into WPF screen.

Direct3D: It is low level API using which graphics of WPF is rendered.

User32: It is primary core API which every program uses. It manages memory and process separation.

GDI & Device Drivers: are Specific to the operating system which used from application to access low level APIs.