The Last Word
As you??™ve seen, WPF supports more than one content model. In the previous chapter, you
learned about panels, which can wrap multiple elements and apply layout logic. In this chapter
you considered content controls, which hold a single element and can range from basics
(labels and buttons) to specialized containers that create scrollable and collapsible regions.
You also took a quick detour to consider decorators, which allow you to add borders and provide
dynamic scaling.
WPF still has more in store. In later chapters, you??™ll learn about items controls that have
yet another content model??”they can hold multiple items, each of which is displayed in a specific
way (in a list box, a tree, a menu, and so on). But first, in the next chapter you??™ll consider
the changes in the WPF event system and a new type of property.
Dependency Properties and
Routed Events
Every .NET programmer is familiar with properties and events, which are a core part of
.NET??™s object abstraction. Few would expect WPF, a user interface technology, to change either
of these fundamentals. But surprisingly enough, that??™s exactly what WPF does.
First, WPF replaces ordinary .NET properties with a higher-level dependency property feature.
Dependency properties use more efficient storage and support higher-level features such
as change notification and property value inheritance (the ability to propagate default values
down the element tree).
Pages:
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283