Questions tagged [datatrigger]

a WPF .NET trigger that applies property values or performs actions when the underlying bound data meets a specified condition.

Summary (from MSDN)

Style, ControlTemplate, and DataTemplate all have a triggers collection. A DataTrigger allows you to set property values when the property value of the data object matches a specified Value. For example, if you are displaying a list of Employee objects, you may want the foreground color to be different based on each Employee's current attendance. (For example, Employees who are currently on vacation are displayed with a purple foreground.) In some scenarios, it may be more suitable to create a converter or to use a DataTemplateSelector. For more information, see the API reference.

838 questions
175
votes
12 answers

DataTrigger where value is NOT null?

I know that I can make a setter that checks to see if a value is NULL and do something. Example: