This documentation is archived and is not being maintained.

MultiTrigger Class

Represents a trigger that applies property values or performs actions when a set of conditions are satisfied.

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

public sealed class MultiTrigger : TriggerBase, 

MultiTrigger enables you to set property values or start actions based on a collection of Conditions. A condition is met when the value of the property (specified by the Property property of the Condition class) of the element matches the specified Value. The comparison is a reference equality check. 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 MultiTrigger object can only consist of Setter objects. Adding a Setter child to a MultiTrigger object implicitly adds it to the SetterBaseCollection for the MultiTrigger object. EventSetter objects are not supported; only Style.Setters supports EventSetter objects.

The following example contains two MultiTriggers. The first sets the MinWidth property value when the HasItems property is false and the Width property is Auto. The second one is similar but is for the MinHeight property.

  <Trigger Property="IsEnabled" Value="false">
    <Setter Property="Background" Value="#EEEEEE" />

      <Condition Property="HasItems" Value="false" />
      <Condition Property="Width" Value="Auto" />
    <Setter Property="MinWidth" Value="120"/>

      <Condition Property="HasItems" Value="false" />
      <Condition Property="Height" Value="Auto" />
    <Setter Property="MinHeight" Value="95"/>

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0