Prev | Current Page 641 | Next

Matthew MacDonald

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

Essentially, a trigger is one of the many property providers that can override the
value that??™s returned by a dependency property. However, the original value (whether it is set locally or by a
style) still remains. As soon as the trigger becomes deactivated, the pretrigger value is available again.
It??™s possible to create multiple triggers that may apply to the same element at once. If
these triggers set different properties, there??™s no ambiguity in this situation. However, if you
have more than one trigger that modifies the same property, the last trigger in the list wins.
For example, consider the following triggers, which adjust a control depending on
whether it is focused, whether the mouse is hovering over it, and whether it??™s been clicked:

Obviously, it??™s possible to hover over a button that currently has the focus.


Pages:
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653