Search This Blog

Tuesday, October 22, 2013

The Architecture of WPF


The Architecture of WPF

The architecture of WPF is multilayer.

WPF API  
  • PresentationFramework.dll
  • PresentationCore.dll
  • WindowsBase.dll
Media Integration Layer
  • Milcore.dll,
  • WindowsCodesc.dll
User 32, Direct 3D


Direct3D renders all drawing WPF.

All display in WPF is done through the DirectX engine -> efficient hardware and software rendering

              
DispatcherObject
  • WPF is based on a messaging system implemented by the dispatcher
  • Uses User32 messages for performing cross thread calls

What is Windows Presentation Foundation (WPF) ?

Windows > Controls > Binding > Printing > Resources

Windows Presentation Foundation (WPF) is a UI framework that creates rich, interactive client applications.
WPF combines application UIs, 2D and 3D graphics, documents and multimedia into one single framework.
The WPF development platform supports a broad set of application development features, including an application model, resources, controls, graphics, layout, data binding, documents, and security.
It is a subset of the .NET. Its vector based rendering engine uses hardware acceleration of modern graphic cards. This makes the UI faster, scalable and resolution independent.

WPF uses the Extensible Application Markup Language (XAML) to provide a declarative model for application programming.

Examples:

 

Create a simple ‘Hello World’ WPF application

WPF > First application

Create a simple ‘Hello World’ WPF application

Go to menu File - > New Project and then Visual C# -> Windows -> WPF Application.

 
Visual studio automatically creates the project and adds some files: MainWindow.xaml and MainWindow.xaml.cs
Double click on MainWindow.xaml and from Toolbox window drag a button and a label. Name label “lblTtitle”.

 
Double click button and add the following code: lblTitle.Content = "Hello World!";

 
Press F5 to run the application