MultiDataTrigger Class
Collapse the table of content
Expand the table of content

MultiDataTrigger Class


Represents a trigger that applies property values or performs actions when the bound data meet a set of conditions.

Namespace:   System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public sealed class MultiDataTrigger : TriggerBase, IAddChild


Initializes a new instance of the MultiDataTrigger class.


Gets a collection of Condition objects. Changes to property values are applied when all the conditions in the collection are met.


Gets the DependencyObjectType that wraps the CLR type of this instance. (Inherited from DependencyObject.)


Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)


Gets a collection of TriggerAction objects to apply when the trigger object becomes active. This property does not apply to the EventTrigger class.(Inherited from TriggerBase.)


Gets a collection of TriggerAction objects to apply when the trigger object becomes inactive. This property does not apply to the EventTrigger class.(Inherited from TriggerBase.)


Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited from DependencyObject.)


Gets a collection of Setter objects that describe the property values to apply when all the conditions of the MultiDataTrigger are met.


Determines whether the calling thread has access to this DispatcherObject.(Inherited from DispatcherObject.)


Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.)


Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.)


Coerces the value of the specified . This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.(Inherited from DependencyObject.)GTMT


Determines whether a provided DependencyObject is equivalent to the current DependencyObject.(Inherited from DependencyObject.)


Gets a hash code for this DependencyObject.(Inherited from DependencyObject.)


Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.)


Gets the Type of the current instance.(Inherited from Object.)


Returns the current effective value of a on this instance of a DependencyObject. (Inherited from DependencyObject.)GTMT


Re-evaluates the effective value for the specified dependency property(Inherited from DependencyObject.)


Returns the local value of a , if it exists. (Inherited from DependencyObject.)GTMT

System_CAPS_pubmethodSetCurrentValue(DependencyProperty, Object)

Sets the value of a without changing its value source. (Inherited from DependencyObject.)GTMT

System_CAPS_pubmethodSetValue(DependencyProperty, Object)

Sets the local value of a , specified by its dependency property identifier. (Inherited from DependencyObject.)GTMT

System_CAPS_pubmethodSetValue(DependencyPropertyKey, Object)

Sets the local value of a read-only , specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.)GTMT


Returns a value that indicates whether serialization processes should serialize the value for the provided .(Inherited from DependencyObject.)GTMT


Returns a string that represents the current object.(Inherited from Object.)


Enforces that the calling thread has access to this DispatcherObject.(Inherited from DispatcherObject.)


Adds a child object.


Adds the text content of a node to the object.

A MultiDataTrigger object is similar to a MultiTrigger, except that the conditions of a MultiDataTrigger are based on property values of bound data instead of those of a UIElement. In a MultiDataTrigger, a condition is met when the property value of the data item matches the specified Value. You can then use setters or the EnterActions and ExitActions properties to apply changes or start actions when all of the conditions are met.

The Setters property of a MultiDataTrigger object can only consist of Setter objects. Adding a Setter child to a MultiDataTrigger object implicitly adds it to the SetterBaseCollection for the MultiDataTrigger object. EventSetter objects are not supported; only Style.Setters supports EventSetter objects.

For information about when to use triggers and when to use other techniques, see Data Templating Overview.

In the following example, the ItemsSource property of the ListBox is bound to Places, an ObservableCollection<T> of Place objects. Place objects have properties Name and State. The definition of Place and Places are not shown.

Each ListBoxItem of the ListBox displays a Place object. The Style in the example is applied to each ListBoxItem. The Condition elements of the MultiDataTrigger specify that if the Name and State of the Place data item are Portland and OR respectively, then the background of corresponding ListBoxItem is set to Cyan.

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
© 2015 Microsoft