Windows Presentation Foundation (WPF)

What is WPF?

There is a lot of BUZZ about Windows Presentation Foundation (WPF).  But what is it?  Here is the low-down!

WPF 101

Windows Presentation Foundation  (WPF) is the desktop user interface platform introduced in the Microsoft .NET Framework 3.0 and enhanced in the .NET Framework 3.5.

It is the graphical subsystem feature of the .NET Framework 3.0 and is directly related to XAML.  It combines the best ideas of Windows Forms and ASP.NET, and then brings a broad range of new features to the table. WPF will require you to rethink the way you design and implement smart client applications.

WPF tools improve developer-designer collaboration through Microsoft Visual Studio®, Microsoft Expression® Interactive Designer, and XAML. WPF enables the developer to write user interface code once and deploy it as a stand-alone client or in a browser. Developers can incrementally take advantage of WPF through interoperability with Win32® and Windows Forms. And they can also use existing knowledge in .NET Framework, CLR languages, and Visual Studio IDE.

WinForms or WPF?

Although WinForms will continue to be widely used, WPF is now the preferred choice for developing line of business applications, especially since the release of the .NET Framework 3.5, Visual Studio 2008, and Expression Blend.

WPF provides a consistent programming model for building applications and provides a clear separation between the UI and the business logic. A WPF application can be deployed on the desktop or hosted in a web browser. It also enables rich control, design, and development of the visual aspects of Windows programs. It aims to unify a host of application services: user interface, 2D and 3D drawing, fixed and adaptive documents, advanced typography, vector graphics, raster graphics, animation, data binding, audio and video.

Microsoft Silverlight is a web-based subset of WPF. During development it was named WPF/E, which stood for "Windows Presentation Foundation/Everywhere". The Silverlight subset enables Flash-like web and mobile applications with the same code as Windows .NET applications. 3D features are not supported, but XPS and vector-based drawing are included.

Why Use WPF?

If you come from the .NET 1.1/2.0 Windows Forms UI world and are still researching the capabilities of WPF vs. Windows Forms technology. In summary, the top 10 reasons are:

1. Advanced Graphics
2. Drawing Object Model
3. Rich Application Text
4. Adaptable UI Layout
5. Flexible Content Model
6. Lookless Controls
7. Data-Driven
8. Consistent Styles
9. Triggers
10. Declarative Programming