CONTENTS
Part VII: Windows Presentation Foundation .....................................................1089
Chapter 27: Introducing Windows Presentation Foundation and XAML ...........1091
The Motivation Behind WPF.........................................................................................1091
Unifying Diverse APIs.......................................................................................................................... 1092
Providing a Separation of Concerns via XAML.................................................................................... 1093
Providing an Optimized Rendering Model .......................................................................................... 1093
Simplifying Complex UI Programming ................................................................................................ 1094
The Various Flavors of WPF .........................................................................................1094
Traditional Desktop Applications........................................................................................................ 1094
Navigation-Based WPF Applications................................................................................................... 1096
XBAP Applications .............................................................................................................................. 1097
The WPF/Silverlight Relationship........................................................................................................ 1099
Investigating the WPF Assemblies...............................................................................1099
The Role of the Application Class ....................................................................................................... 1101
The Role of the Window Class ............................................................................................................ 1103
Building a WPF Application Without XAML ..................................................................1107
Creating a Strongly Typed Window .................................................................................................... 1109
Creating a Simple User Interface........................................................................................................ 1110
Interacting with Application-Level Data ............................................................................................. 1112
Handling the Closing of a Window Object........................................................................................... 1113
Intercepting Mouse Events ................................................................................................................. 1114
Intercepting Keyboard Events............................................................................................................. 1115
Building a WPF Application Using Only XAML..............................................................1117
Defining a Window Object in XAML .................................................................................................... 1118
Defining the Application Object in XAML ............................................................................................ 1119
Processing the XAML Files Using msbuild.exe ................................................................................... 1120
Transforming Markup into a .NET Assembly ...............................................................1122
Mapping the Window XAML Markup to C# Code ................................................................................ 1122
xli
4