Triggers

Triggers allow the developer to specify actions declaratively in XAML to change the appearance of controls based on events or property changes. For eg, you may want to change the appearance of a button when it is in pressed state vs when it is not pressed. A trigger can be directly assigned to control.

There are namely four types of triggers:

  • Property Trigger: Property Trigger comes into action when the value of the property of a control is assigned a value

  • Data Trigger: It uses data binding to associate changes for some other control. When there are changes to another control, Data Trigger triggers changes in the control

  • Event Trigger: An Event trigger causes an action to happen when an event takes place

  • Multi-Trigger: This is a special type of trigger which gets triggered when multiple trigger conditions get satisfied resulting in the raising of this trigger.

Last updated