Social Icons

Friday, 12 July 2013

What is WPF(Windows Presentation Foundation) Introduction to WPF, WPF features ,WPF Advantages

WPF - Windows Presentation Foundation


      Now we will see Basic things about WPF like what is WPF in .Net, what are the WPF features or Advantages over Windows Forms.


What is WPF?

WPF - Windows Presentation Foundation which is part of .Net Framework 3.0 or Higher. It is the next generation presentation system for building Windows Client Applications.
           WPF initially called as avalon which is part of WInFX. What is WinFx means it is part of .NET framework that exist on every system which runs on microsoft windows operating system.(Windows Future Storage as per wiki ).

          WPF's main purpose is to provide Rich Graphics and animations and  also make windows application development easy and fast. Microsoft stops developing Windows Forms with the version 2.0 and future Windows App development in .Net will be by using WPF and Windows Forms may be eliminated in the future. We can say WPF was replacement of Windows Forms.

Features of WPF:

  • Supports Fixed and Flow format documents.
  •  Has all the features of HTML and Flash.
  •  WPF provides a new Markup Language XAML pronounced as Zammel that makes designing easy and fast.We could discuss what is XAML in later.
  • WPF uses vector graphics where as Windows Forms uses Scalar Graphics. Advantage of vector graphics over scalar graphics is you can take image or video fo any size and large it to any size, the quality of that image or video will not be affected.i.e WPF Applications are Independent of Screen Resolution(DPI).
  • WPF can utilize complete acceleration supported by user graphics hardware where as Windows Forms has limit. Hence graphics created in WPF are smoother than Windows Forms graphics.
  • In WPF any control can contain any other control with in it and hence rich composition like
    list of radio buttons with in a ListBox Control and displaying images with in the foreground and background in the control is possible which are not possible in Windows Forms.
  • WPF provides a number of predefined types for creating animations that makes it easy and fast to
    create Animations.
  • Styles: It was the fantastic technique using which we can separate appearance and behavior of Controls in WPF Applications.i. e We can define static appearance in .xaml file and we can control or change it's behavior and appearance also from Three different Levels. i.e Control Level,Window Level and Application Level. From these three levels we change the appearance and behavior controls(Discus this in Styles and Resources later on).
  • Binding : It is the fine thing which boost the WPF to higher level of development. In WPF we can have different types of Binding levels or Approaches using which we can develop applications without writing single line of code in .cs file. We could do the All bindings in XAML only with the help of DataTemplates, Resources, Triggers, Events Concepts in WPF.
  • Triggers: One of the Advantage of XAML is Triggers. We can declaratively write Events of Controls in XAML. In WPF three types of triggers available i.e Property Triggers, Event Triggers, Data Triggers i.e we can change the Controls behavior and appearance based on the values changed in Properties,Based on Events, Based on Data Present in the Controls.
  • WPF Interoperability: We can easily use Windows Forms Controls in WPF using Windows Forms Host control by declaring them as children of this control. In the same manner we can easily use WPF Controls in Windows Forms Applicaiton Using ElementHost Control.
  Using WPF we can create two types of applications.

  WPF Application --> Windows
  WPF Browser Application --> Pages

         WPF Applications are apps that run directly on desktop and WPF Browser Applcations are app's that run in a browser. If it is a WPF app then to make your application available in every system in the network we have to install it in every system, it is not possible to install it on server and accessing it on all the clients in network.But when your app is WPF Browser application then it can be installed on  server at network and accessing from any client in the network without installing it client system is possible.

        WPF App contains Windows where as WPF Browser App contains Pages.A Page or Window is saved in two files one with .XAML and another with .XAML.cs  .XAML file contains Zammel code design on the page and .cs file contains business logic that is the code you write in the events of that controls using

A Window will have <Window> tag and a page will have <Page> tag as root element.

Page and Window tag has the following Important properties.

x:class -> used to specify the class name for the window or page with in that code.

xmlns and xmlsn:x  are the properties used to specify the URL of the namespace that contain 'XAML' specification, which contain the information about which tags of XAML are Link to which classes in .net framework to make xaml tags understandable to the compiler.

Whenever you create a window or page these will automatically comes in XAML code. Additionally if you
want to use any other third party controls or windows forms control then you need to refer it here.

Before going to Work with WPF Applications it is better to see the WPF Architecture and Controls Object Hierarchy.


   These are the basic information regarding WPF, WPF features.One important thing in WPF is its MVVM architecture like MVC for Asp.Net, which gives flexibility for developers to develop applications. I suggest you you must know the MVVM architecture before you work with WPF. In later on Applications we could see the what is XAML, Implementing MVVM architecture in WPF applications.

        Don't forget to Comment and Share for your friends if you like this post. Thank You. 

Related Articles:

No comments:

Post a Comment

Please Give your Valuable Suggestions,Questions and Comments to improve my blog.