Using behaviors
Triggers have inherent limitations; new trigger types cannot be created, nor new trigger actions. These decisions made by the WPF designers are somewhat arbitrary, as there may be useful triggers and actions that could have been created by developers. It may be somewhat justified, however, preventing abuse of this feature that may degrade performance (for heavy duty triggers or actions). Still, abuse is possible almost everywhere that software exists.
Whether this decision is justified or not is a matter of opinion; it is a fact nonetheless.
A possible solution to the extensibility problem is to write a similar open-ended mechanism and expose it through attached properties. This is exactly what was done by the Expression Blend team ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access