What are Triggers? How many types of Triggers are available?

Technology CommunityCategory: XamarinWhat are Triggers? How many types of Triggers are available?
VietMX Staff asked 3 years ago

Triggers allow us to declare actions in XAML which changes the appearance of the control when specific condition is met for specific control property or specific event is raised.

We can add triggers to the control-level, page-level or application-level in the resource dictionary. There are four types of Triggers.

  • Property Trigger: executed when a property on a control is set to a particular value
  • Data Trigger: It is similar to the property trigger but it leverages the use of data binding
  • Event Trigger: occurs when some specified event is raised on the control
  • Multi Trigger: allows multiple trigger conditions to be set before an action occurs