WPF, stands for Windows Presentation Foundation is a development framework and a sub-system of .NET Framework. WPF is used to build Windows client applications that run on Windows operating system. WPF uses XAML as its frontend language and C# as its backend languages.
WPF was introduced as a part of .NET Framework 3.0 as the Windows library to build Windows client apps and the next generation of Windows Forms. The current version of WPF is 4.5.
WPF is the engine that is responsible for creating, displaying, and manipulating user-interfaces, documents, images, movies, and media in Windows 7 and later Windows operating systems. WPF is a set of libraries that have all functionality you need to build, run, execute, and manage Windows client applications.
Learn more about WPF here: Learn WPF
WPF and XAML
XAML is a new descriptive programming language developed by Microsoft to write user interfaces for next-generation managed applications. XAML is used to build user interfaces for Windows and Mobile applications that use Windows Presentation Foundation (WPF), UWP, and Xamarin Forms.
The purpose of XAML is simple, to create user interfaces using a markup language that looks like XML. Most of the time, you will be using a designer to create your XAML but you’re free to directly manipulate XAML by hand.
XAML uses the XML format for elements and attributes. Each element in XAML represents an object which is an instance of a type. The scope of a type (class, enumeration etc.) is defined a namespace that physically resides in an assembly (DLL) of the .NET Framework library.
Similar to XML, a XAML element syntax always starts with an open angle bracket (<) and ends with a close angle bracket (>). Each element tag also has a start tag and an end tag. For example, a Button object is represented by the <Button> object element. The following code snippet creates a Button object element.
<Button></Button>
Alternatively, you can use a self-closing format to close the bracket.
<Button />
Here is a free Ebook download on XAML: Programming XAML
WPF and C#
While XAML is used to build user interfaces in WPF, C# is used as the code-behind languages in WPF. While Windows and their controls are created in XAML at design-time, they can also be created at runtime using C# language.
C# is also used to write all events programming and business logic. All actions, events, and rendering is done in the code behind C# code.
Here is a free C# programming book: C# Programming for Beginners
WPF Resources
WPF supports two types of resources, static and dynamic.
Static Resources: A Static Resource will be resolved and assigned to the property during the loading of the XAML that occurs before the application is actually run. It will only be assigned once and any changes to the resource dictionary is ignored.
Dynamic Resources: A Dynamic Resource assigns an Expression object to the property during loading but does not actually lookup the resource until runtime when the Expression object is asked for the value. This defers looking up the resource until it is needed at runtime. A good example would be a forward reference to a resource defined later on in the XAML. Another example is a resource that will not even exist until runtime. It will update the target if the source's resource dictionary is changed.
Here is a detailed tutorial: Resources in WPF
WPF Styles
Style is a way to group similar properties in a single Style object and apply to multiple objects. The Style element in XAML represents a style. A Style is usually added to the resources of a FrameworkElement. The x:Key is the unique key identifier of the style.
Here is a detailed tutorial: Styles in WPF
Templates in WPF
Templates are an integral part of user interface design in WPF. This article explains templates, their types and how to use them in Windows applications.
WPF has the following three types of templates, Control Template, Items Panel Template, and Data Template.
Here is detailed tutorial: Templates in WPF
Data Binding in WPF
Binding allows you to link a source object to some control. There are the following two types of bindings:
- One-Way Binding: Binds a source to the interface.
- Two-Way Binding: Binds a source to the interface and back to the source.
INotifyPropertyChanged interface allows sources to interact with the interface and update it as the values change.
- To bind an object or a list to an element you must set the DataContext property.
- It is possible to bind an object or a list of objects and you can bind one element to another.
- To customize how bound data will be displayed you can set the DataTemplate from a control.
- It is possible to set Data Converters to convert the source type to another type.

Harun OconnellPosted Jan 31, 2023, 8:52 PM
MainForm mainForm = new MainForm(); mainForm.Show(); Close(); WPF CLOSE WINDOW
Ashish SrivastavaPosted May 16, 2016, 2:24 AM
nice
Mayur PadhiyarPosted Nov 16, 2015, 8:25 AM
Can you tell me Maheshsir the major difference of wpf for desktop and wpf for browser? What is preferable to use for browser side wpf or web forms?
Former memberPosted Jul 31, 2013, 6:42 AM
Nice Article sir
Mahesh ChandPosted Sep 30, 2012, 8:06 PM
Yes Muhammad. WPF is for Windows applications only.
Muhammad SabriPosted Jul 24, 2012, 2:53 PM
Is WPF only for Windows Vista applications?
Raymond FuPosted Mar 10, 2010, 5:12 PM
I just wrote a blog about the difference between WPF and Windows Forms http://geekatwork.wordpress.com/2010/03/09/wpf-vs-windows-form/
Mahesh ChandPosted May 9, 2007, 9:44 AM
Yes Kadir. Go ahead and link back to the original link. Best, Mahesh
Kadir CamogluPosted May 9, 2007, 1:49 AM
Can I translate it in Turkish for Turkish developers?