Skip to content
TheFeatherCoder edited this page Nov 11, 2015 · 1 revision

WPF stands for Windows Presentation Foundation and offers a possibility to create graphical users interfaces. WPF vs WinForms. Both server the same purpose (creating GUIs), but there is a lot of difference between them. The single most important difference between WinForms and WPF is the fact that while WinForms is a layer on top of the standard Windows controls( e.g. TextBox), WPF is build from scratch and doesn't rely on Windows controls. As example of this is a button with an image and text on it. This is not a standars Windows control, so WinForms doesn't offer tis possibility out of the box. Instead, you will have to draw the image yourself, implement your own button that supports images or use a 3rd party control. With WPF, a button can contain anything because it's essentially a border with content and various states. The WPF button, like most of other WPF controls, is "look-less" which means that it can contain a range of other controls inside of it.

WPF is a combination of XAML (markup language) and C#/VB.NET/other .NET language. All of it can be edited in a text editor, and then compiled from the command line.

What is XAML? XAML (eXtensible Application Markup Language) is Microsoft variant of XML describing a GUI. The XAML describes the interface with all its elements, while the CodeBehind handles all the events and has access to manipulate with the XAML controls. Creating a control in XAML is as easy as writing it's name, surronded by angle brackets. For instance, a button looks like this: ot .... (This is not a XAML tutorial :D )

Next we will have a look at the structure and various aspects of a WPF application.

Clone this wiki locally