WPF Architecture – An overview of Windows Presentation Foundation (WPF) Architecture

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 diagram - Architecture of WPF
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.

Managed Layer

The public API exposed is only via this layer. Major portion of the WPF is in managed code.

  1. 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.
  2. 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.
  3. WindowsBase.dll :- Holds more basic elements which are capable to be reused outside the WPF environment like Dispatcher objects and Dependency objects.

UnManaged Layer

  1. 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.
  2. 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)

  1. DirectX :- DirectX is the low level API through which WPF renders all graphics.
  2. 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 …

About the Author: Ashish Ramteke

Ashish Ramteke is a Software Professional, Part time blogger and founder of C# Tutorials, a popular blog on C#.Net. Ashish is having 6 years of work experience and an engineering degree in Computer Science and Engg.

7 Comments+ Add Comment

  • Good Explanation in simple way.. 🙂

  • Its very interesting and quite simple and basic understanding

  • Great post. WPF seems really nice.

  • Its very useful for beginners and on architecture overview.

  • sharing is really caring. t’s for overview

  • Hi, nice wpf architecture overview.Thanks….


  • Super..thanks a lot.

Leave a comment