Prev | Current Page 321 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"


Once the initialization process is complete, the Loaded event is fired. The Loaded event
follows the reverse path of the Initialized event??”in other words, the containing window fires
the Loaded event first, followed by more deeply nested elements. When the Loaded event has
fired for all elements, the window becomes visible and the elements are rendered.
The lifetime events listed in Table 6-3 don??™t tell the whole story. The containing window
also has its own more specialized lifetime events. These events are listed in Table 6-4.
CHAPTER 6 n DEPENDENCY PROPERTIES AND ROUTED EVENTS 167
Table 6-4. Lifetime Events for the Window Class
Name Description
SourceInitialized Occurs when the HwndSource property of the window is acquired (but
before the window is made visible). The HwndSource is a window
handle that you may need to use if you??™re calling legacy functions in the
Win32 API.
ContentRendered Occurs immediately after the window has been rendered for the first
time. This isn??™t a good place to perform any changes that might affect
the visual appearance of the window, or you??™ll force a second render
operation. (Use the Loaded event instead.) However, the
ContentRendered event does indicate that your window is fully visible
and ready for input.
Activated Occurs when the user switches to this window (for example, from
another window in your application or from another application).


Pages:
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333