FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Dobbs M-Dev
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
TABLE OF CONTENTS
March 12, 2007
Properties, Dependency Properties, and WPF

Putting XAML to work

(Page 1 of 5)
Charles Petzold
Windows Presentation Foundation implements two complementary programming interfaces, letting you write entire WPF applications using a .NET-compliant programming language (or at least parts of it) using XAML.
Charles has been writing about Windows application programming for over 20 years. His most recent book is Applications = Code + Markup: A Guide to the Microsoft Windows Presentation Foundation, and he is currently working on a book about 3D graphics under the WPF. He can be contacted at www.charlespetzold.com.


Throughout the 20-odd years of its existence, Microsoft Windows has always exhibited a fairly high degree of backward compatibility. With relatively few examples, programs written for one version of Windows continue to run on the next.

Windows Vista continues this trend: It runs programs written for the Win32 API, for the Microsoft Foundation Classes (MFC), for Visual Basic, and for the Windows Forms library of .NET 1.0 and 2.0.

Vista also implements a new application programming interface called the "Windows Presentation Foundation" (WPF), previously known under the codename "Avalon." The WPF is also available under Windows XP with the .NET Framework 3.0 installed. (Alternatively, you can think of WPF as part of .NET 3.0, which can be installed under XP but which is built into Vista.)

Compared with the previous mainstream APIs for Windows, the WPF breaks new ground by implementing two complementary programming interfaces. You can write entire WPF applications in your favorite .NET-compliant programming language such as C# or Visual Basic .NET, but you can also write at least parts of the application using the XML-based Extensible Application Markup Language (XAML, pronounced "zammel").

Although XAML has been classified as a declarative programming language, it is mostly restricted to instantiation and initialization of visual objects. In simple scenarios, you use XAML to define the layout of controls on your windows, and you use code to implement event handlers for these controls. You compile the XAML and code together into an executable.

However, several features of the WPF—such as data binding and animation—let you write interesting XAML files that stand by themselves. These standalone XAML files can be launched under Vista or .NET 3.0 just like other executables, and they run in the web browser.

1 Properties, Dependency Properties, and WPF | 2 Instantiation and Initialization | 3 A Stack of Text | 4 Measure and Arrange | 5 Retained Graphics Next Page
RELATED ARTICLES
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK