Bookmark and Share Share...    Subscribe to this feed Feed   About Christian Moser  

Introduction to Windows Presentation Foundation


The Windows Presentation Foundation is Microsofts next generation UI framework to create applications with a rich user experience. It is part of the .NET framework 3.0 and higher.

WPF combines application UIs, 2D graphics, 3D graphics, documents and multimedia into one single framework. Its vector based rendering engine uses hardware acceleration of modern graphic cards. This makes the UI faster, scalable and resolution independent.

The followinig illustration gives you an overview of the main new features of WPF

Separation of Appearance and Behavior

WPF separates the appearance of an user interface from its behavior. The appearance is generally specified in the Extensible Application Markup Language (XAML), the behavior is implemented in a managed programming language like C# or Visual Basic. The two parts are tied together by databinding, events and commands. The separation of appearance and behavior brings the following benefits:

  • Appearance and behaviour are loosely coupled
  • Designers and developers can work on separate models.
  • Graphical design tools can work on simple XML documents instead of parsing code.

Rich composition

Controls in WPF are extremely composable. You can define almost any type of controls as content of another. Although these flexibility sounds horrible to designers, its a very powerful feature if you use it appropriate. Put an image into a button to create an image button, or put a list of videos into a combobox to choose a video file.

    <StackPanel Orientation="Horizontal">
        <Image Source="speaker.png" Stretch="Uniform"/>
        <TextBlock Text="Play Sound" />

Highly customizable

Because of the strict separation of appearance and behavior you can easily change the look of a control. The concept of styles let you skin controls almost like CSS in HTML. Templates let you replace the entire appearance of a control.

The following example shows an default WPF button and a customized button.

Resolution independence

All measures in WPF are logical units - not pixels. A logical unit is a 1/96 of an inch. If you increase the resolution of your screen, the user interface stays the same size - it just gets crispier. Since WPF builds on a vector based rendering engine it's incredibly easy to build scaleable user interfaces.

Last modified: 2011-08-15 18:49:42
Copyright (c) by Christian Moser, 2011.

 Comments on this article

Show all comments
Pham Kien Quoc
Commented on 17.September 2011
Very useful for beginner in just 5 min .
Thanks a lot.
Commented on 19.September 2011
very good...
Commented on 19.September 2011
It really gud :)
Commented on 20.September 2011
Good one
Commented on 20.September 2011
Thank you..I think its more helpful for the beginners in WPF
Amit Verma
Commented on 20.September 2011
very helpful and easy to understand
Abu Hanin
Commented on 20.September 2011
Similar to MSDN documentation but looks nicer &amp; richer
Commented on 21.September 2011
there is an sql error on the tutorials like user desing process...please fix it out asap...thankyou
Sweta Pandey
Commented on 21.September 2011
Thanks Sir, thank you so much for all notes and example of WPF.........
Commented on 22.September 2011
It is so beautifully explained that any one can understand.
BoYu Gao
Commented on 22.September 2011
that is wonderful
Commented on 22.September 2011
You really need a spellchecker and a proofreader. Crispier??
Commented on 22.September 2011
one word. AWESOME!
Commented on 23.September 2011
Very nice article for WPF Beginners...
Commented on 23.September 2011
Pushing the beginners to mine more !!! .... Good
Commented on 23.September 2011
Very nice article for WPF Beginners...
Commented on 24.September 2011
Cool.. been looking for a nice WPF intro and this is by far the best and coolest... thanks
Commented on 25.September 2011
This is very helpful to learn
Commented on 26.September 2011
This article has given nice introduction to the wpf beginners.
Mobashir Ahmad
Commented on 26.September 2011
Good Explaination
Commented on 26.September 2011
really...good one
Commented on 27.September 2011
Good one
Commented on 27.September 2011
What a intro?????
Commented on 27.September 2011
very useful
Commented on 27.September 2011
thnxx sir nice intro

E-Mail (optional)