MultiTrigger Class
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
'Declaration <ContentPropertyAttribute("Setters")> _ Public NotInheritable Class MultiTrigger Inherits TriggerBase Implements IAddChild 'Usage Dim instance As MultiTrigger
/** @attribute ContentPropertyAttribute("Setters") */
public final class MultiTrigger extends TriggerBase implements IAddChild
ContentPropertyAttribute("Setters") public final class MultiTrigger extends TriggerBase implements IAddChild
<MultiTrigger> Setters </MultiTrigger>
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.
<Style.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" Value="#EEEEEE" /> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="HasItems" Value="false" /> <Condition Property="Width" Value="Auto" /> </MultiTrigger.Conditions> <Setter Property="MinWidth" Value="120"/> </MultiTrigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="HasItems" Value="false" /> <Condition Property="Height" Value="Auto" /> </MultiTrigger.Conditions> <Setter Property="MinHeight" Value="95"/> </MultiTrigger> </Style.Triggers>
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.TriggerBase
System.Windows.MultiTrigger
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.