What and Why WPF?

WPF stands for Windows Representational Foundation. It’s a graphical system to create Windows application.

Why WPF as we already have win forms graphical system? There are lot of benefits of WPF over win form some are below-

  1. A- Anywhere execution(XAML). Since internal representational of WPF is XAML which is internally XML. So it can be execute as win form and in wpf browser application.
  2. B- Binding. This is also important feature of WPF. We can communicate between controls or object by just doing some property bindings instead of writing code. Ex. If there are two textbox and want the behavior like if we change the value of one textbox then second textbox value should change then it can be achieved by just setting text properties.
  3. C- Common look and feel(Styles). We can create and apply the styles like web application CSS to the wpf controls for common look and feel instead of writing same styles for defferent controls.
  4. D- Directive Programming. This is that instead of writing code we can change the behavior by just setting properties in the XAML code and rest wpf system will handle itself. Like Binding.
  5. E- Expression Blend and animation. As Wpf uses the DirectX which is a animation tool so implementing the animation is much easy in wpf application.
  6. F- Faster Execution (Hardware Rendering). As win forms rendering is done via GDI which uses the CPU for rendering( also called software rendering), as CPU also responsible for other stuff like memory management, processing etc.. os some time it become slower. But WPF rendering is done via DirectX which uses the GPU (Graphical Processing Unit) for rendering( also called hardware rendering) because this meant for only rendering so wpf rendering is faster then win forms. If GPU is not found then it uses the CPU. DirectX also responsible to identify what part of rendering should be done via CPU and what via GPU. DirectX performs this action into tiers.
  7. G- Graphic Independency(DIP). Since win forms application internally uses the device pixecles to render control so it becomes developer responsibility to handle this scenario to run application in all type of screen resolution which is itself a big task. But WPF uses the DIP(DEVICE INDEPENDENT PIXCEL) which makes the developer life easy to run application independently screen resolution.
Advertisements