Prev | Current Page 294 | Next

Matthew MacDonald

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

The default value (as set by the FrameworkPropertyMetadata object)
2. The inherited value (if the FrameworkPropertyMetadata.Inherits flag is set and a value
has been applied to an element somewhere up the containment hierarchy)
3. The value from a theme style (as discussed in Chapter 15)
4. The value from a project style (as discussed in Chapter 12)
5. The local value (in other words, a value you??™ve set directly on this object using code
or XAML)
As this list shows, you override the entire hierarchy by applying a value directly. If you
don??™t, the value is determined by the next applicable item up on the list.
nNote One of the advantages of this system is that it??™s very economical. If the value of a property has not
been set locally, WPF will retrieve its value from a style, another element, or the default. In this case, no
memory is required to store the value. You can quickly see the savings if you add a few buttons to a form.
Each button has dozens of properties which, if they are set through one of these mechanisms, use no
memory at all.
CHAPTER 6 n DEPENDENCY PROPERTIES AND ROUTED EVENTS 150
WPF follows the previous list to determine the base value of a dependency property. However,
the base value is not necessarily the final value that you??™ll retrieve from a property. That??™s
because WPF considers several other providers that can change a property??™s value.


Pages:
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306