Monday, October 8, 2007

WPF Tutorial

With all the new technology that Microsoft is releasing, it's hard to keep up. WPF is one such technology. It is a completely different metaphor for user interface construction than previous frameworks. This article is intended to give a general overview of the key concepts and innovations of WPF, hopefully educating readers enough to make intelligent UI technology decisions and smooth the learning curve for those beginning to work with this framework.

Introduction

Windows Presentation Foundation (hereafter referred to as WPF) is a new API for creating graphical user interfaces for the Windows platform. It is an alternative to WinForms that further empowers developers by providing an API capable of taking full advantage of the multimedia facilities of the modern PC. Unlike WinForms, it does not wrap Win32 but is completely new, built from the ground up using .NET. The fundamental power of WPF comes from the fact that it is vector based, hardware accelerated and resolution independent.

Reminiscent of WinForms, you’ll find many of the controls you are used to when building applications: Button, ComboBox, ListBox, etc. However, in WPF, your UI design is represented in a completely different fashion. Instead of using a designer generated code file or a resource file as the source of a UI definition, WPF uses XML. Specifically, it uses XAML. Please, don’t let this frighten or dissuade you. It’s surprisingly intuitive and much easier than you would think (not to mention fun). There are many other new features in WPF, too many to discuss in this tutorial. Below, you can see a chart depicting what I consider to be some of the most important features/innovations in WPF.

Figure 1: Important WPF Features



Continue reading...