In this article we are going to see an overview of Windows Presentation Foundation. In previous WPF tutorial i have explained a basic introduction to WPF. I would suggest to read that article because it explains why Microsoft introduced WPF and how it is better than Windows Forms applications.
To know more about the Windows Presentation Foundation(WPF), one must have a clear idea about the architecture of WPF. So lets get some overview of wpf architecture.
Overview of Windows Presentation Foundation
The architecture of WPF is actually multilayered architecture. It spans across three layers – 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 of WPF are illustrated in below wpf diagram.-
|WPF – Architecture of WPF|
Presentation Framework, Presentation Core and Media Integration layer (milCore) are the three major components of WPF architecture. These are the major code portions of WPF and plays a vital role in an overview of Windows Presentation Foundation. MilCore is written in UnManaged code in order to enable tight integration with DirectX. DirectX engine is responsible for all visual effects in WPF, allowing for efficient hardware and software rendering. CLR provides the fine control over memory and execution. The composition engine in milCore is extremely performance sensitive, and required giving up many advantages of the CLR to gain performance.
The public API exposed is only via this layer. Major portion of the WPF is in managed code.
- PresentationFramework.dll :- It holds the top level WPF elements, including those that represents Windows, panels, controls, styles etc. It also implements the end-user presentation features including time-dependent, story-based animations and data binding.
- PresentationCore.dll :- Presentation Core provides a managed wrapper for MIL and implements the core services for WPF such as UI Element and visual from which all shapes and controls derived in PresentationFramework.dll.
- WindowsBase.dll :- Holds more basic elements which are capable to be reused outside the WPF environment like Dispatcher objects and Dependency objects.
- milCore.dll :- While the majority of WPF is in managed layer, the composition engine which renders the WPF application is a native component. It is called as Media Integration Layer (MIL) and resides in milCore.dll. The purpose of the milCore is to interface directly with DirectX and provide basic support for 2D and 3D surface. It is the main rendering engine of WPF and is interface between DirectX and CLR.
- WindowsCodecs.dll :- WindowsCodecs is another low level API which is used for imaging support in WPF applications like image processing, image displaying and scaling etc. It comprises of a number of codecs which encode/decodes images into vector graphics that would be rendered into WPF screen.
Core operating System Layer (Kernel)
- DirectX :- DirectX is the low level API through which WPF renders all graphics.
- User32 :- It the primary core API which every application uses. User32 actually manages memory and process separation.
To understand overview of Windows Presentation Foundation we should know that all WPF applications start with two threads – one is for managing the UI and another background thread is to handle the rendering and repainting. Rendering and repainting is managed by WPF itself and doesn’t require any developer intervention.
I hope now you got the overview of Windows Presentation Foundation and you understand the wpf achitecture. Sharing is caring. Please share the article on your favourite social media if you think it’s worth to share.
More WPF Related articles for you …
- Introduction to WPF.
- How to create WPF Application.
- How to handle events in WPF.
- Understanding Event handling in WPF.
- How to consume WCF service in WPF application.
- More WPF articles…