Prev | Current Page 345 | Next

Matthew MacDonald

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


The Last Word
In this chapter, you took a deep look at WPF dependency properties and routed events. First,
you saw how dependency properties are defined and registered and how they plug into other
WPF services. Next, you explored routed events and saw how they allow you to deal with
events at different levels??”either directly at the source or in a containing element. Finally, you
saw how these routing strategies are implemented in the WPF elements to allow you to deal
with keyboard and mouse input.
It may be tempting to begin writing event handlers that respond to common events such
as mouse movements to apply simple graphical effects or otherwise update the user interface.
But don??™t start writing this logic just yet. As you??™ll see later in Chapter 12, you can automate
many simple program operations with declarative markup using WPF styles and triggers. But
before you branch out to this topic, the next chapter takes a short detour to show you how
many of the most fundamental graphical widgets (things such as buttons, labels, and text
boxes) work in the WPF world.
nTip One of the best ways to learn more about the internals of WPF is to browse the code for basic WPF
elements, such as Button, UIElement, and FrameworkElement. One of the best tools to perform this browsing
is Lutz Roeder??™s Reflector, which is available at http://www.


Pages:
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357