WPF stands for Windows Presentation Foundation.It is a framework for developing windows applications using the .NET framework.It is a successor of MFC and Windows forms for the development of windows applications.
It provides several advantages over windows forms for developing desktop applications.It has the following features:
- It uses DirectX for rendering instead of GDI(which was used in windows forms applications)
- It uses XAML instead of C# for the development of GUI(which was used in windows forms applications)
- It uses dependency properties which provides additional services on top of CLR properties
When a windows forms application is run then their are few areas which the developer need to handle.
One is that windows forms application are not resolution independent.This means that the same application will be rendered differently on different devices.This is because windows applications uses pixels to render the UI.WPF applications on the other hand uses device independent pixels for rendering.This means that the same application UI will not be impacted based on the screen size.
Other problem which WPF solves is that it uses vector based graphics for rendering in comparison to the raster graphics used by windows forms applications.The problem with raster based graphics is that they loose clarity when resized.Also lot of memory is wasted when using raster graphics.
Another advantage of using WPF for windows applications is that WPF separates the UI and the application logics.The UI is developed using XAML as:
The logic for this UI is declared separately in the code behind as:
public partial class AppWindow : Window
public AppWindow ()