WPF Overview: Architecture & Class Hierarchy

Updated on     Kisan Patel

WPF offers several features and functionalities to develop high-end desktop applications. It supports various media, such as text, images, audio, video and allows you to work with Two-dimensional (2-D) as well as Three-dimensional (3-D) graphics.

In Windows Forms that require numerous technologies to work with 2-D, 3-D and multimedia. Some examples of these technologies are: GDI+, Windows Media Player API, and DirectX APIs. Unlike Windows Forms, WPF inherently provides these technologies, so that you do not need separate APIs in WPF to work with graphics, animations and multimedia. Therefore, it is easier and simpler to develop graphics-rich desktop applications by using WPF. All the design-related elements in WPF applications are processed by DirectX.

WPF also supports Extensible markup language based on Extensible Markup Language (XML) introduced by Microsoft Corporation. This markup language allows designers to easily and quickly define and describe the elements for the UI of WPF applications. After that, application developers can use the UI elements defined with the help of XAML to specify the application logic in the code-behind files in any of the .NET languages, such as C#. In addition, you can also use the code-behind files to create UI elements at run time.

WPF Architecture

WPF contains both managed and unmanaged components. Since the managed components of WPF are based on the Common Language Runtime (CLR). they make use of the different features of CLR, such as cross-language integration, type safety and security, debugging and exception handling, and garbage collection. Most of the functionalities and features of WPF are provided through managed components. In addition to managed components, WPF contains an unmanaged component called the Media Integration Layer (MIL or milcore).

wpf-architecture

In above figure you can see WPF consists of managed components, namely PresentationFramework, PresentationCore, WindowsBase and CLR and unmanaged components, such as milcore, User32, WindowsCodecs, DirectX and Kernel.

PresentationFramework

The PresentationFramework component is implemented as PresentationFramework.sll assembly in .NET Framework. This component provides classes to control the appearance and presentation of WPF applications. For example, controls, layout, data binding and animations in WPF applications.

PresentationCore

The PresentationCore component is implemented as the PresentationCore.dll assembly in .NET Framework. This component provides classes and types such as properties, events and messages in WPF.

WindowsBase

The WindowsBase component is implemented as the WindowsBase.dll assembly in .NET Framework. This component provides the fundamental WPF features, such as threading, type converters, and dependency properties.

MIL or Milcore

Milcore is an unmanaged component in WPF. Milcore interacts with DirectX and acts as a medium or interface between DirectX and CLR. Due to this interaction with DirectX, milcore allows the display of 2-D as well as 3-D graphical content in WPF applications and also allows you to work with animations, render 3-D scenes and much more.

Milcore has a composition engine that uses the hardware and software rendering of DirectX for WPF applications.

WPF Class Hierarchy

The managed components of WPF provides several types and classes. All the WPF classes are inherited from the System.Object class, which is the base class for all types and classes in .NET Framework.

Below figure shows WPF class hierarchy that is, the relationship between the WPF classes:

wpf-class-hierarchy


WPF

Leave a Reply