At the same time, you took a look at three variants: creating a
WPF application through code alone, creating a WPF page with nothing but XAML, and
loading XAML manually at runtime.
Although you haven??™t had an exhaustive look at every detail of XAML markup, you??™ve
learned enough to reap all its benefits. Now, your attention can shift to the WPF technology
itself, which holds some of the most interesting surprises. In the next chapter you??™ll start out
by considering the core of the WPF application model: the Application class.
CHAPTER 2 n XAML 58
The Application
While it??™s running, every WPF application is represented by an instance of the
System.Windows.Application class. This class tracks all the open windows in your application,
decides when your application shuts down, and fires application events that you can handle
to perform initialization and cleanup.
The Application class isn??™t one of the more fascinating parts of WPF. However, because
every WPF application uses the Application class, learning how it works is required reading.
In this chapter, you??™ll quickly get the essentials.
nNote The System.Windows.Application class plays the same role in a WPF application as the
System.Windows.Forms.Application class plays in a Windows Forms application. But Microsoft, always
happy to reinvent the wheel, has given each one subtly different members and functionality.
Pages:
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169