O'Reilly logo

XAML Developer Reference by Ashish Ghoda, Mamta Dalal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Triggers

Triggers enable you to set or modify attributes of an element based on a specific action. Triggers can either act on single instances of an element or they can affect an entire class of elements.

A simple example of a trigger and its corresponding action is that of a button changing its background color based on a mouse hover or mouse click action.

The Style, ControlTemplate, and DataTemplate elements have a Triggers property that contains a set of triggers.

Triggers in WPF are of various types: property triggers, event triggers, data triggers, multi triggers, and multi data triggers.

Property Triggers

Supported By

WPF

Yes

Silverlight

Yes

Defining a property trigger is simple. You define a Trigger element, specify the property change that initiates ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required