MultiTrigger.Setters Property

Gets a collection of Setter objects, which describe the property values to apply when all of the conditions of the MultiTrigger are met.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

'Declaration
Public ReadOnly Property Setters As SetterBaseCollection
<object>
  <object.Setters>
    ZeroOrMoreSetters
  </object.Setters>
</object>

XAML Values

ZeroOrMoreSetters

Zero or more Setter objects. EventSetter objects are not supported.

MultiTrigger enables you to start actions or set property values using Setter objects when a set of conditions have been met.

If there are two Setter objects in the same or different setter collections setting the same property, the Setter that is declared last is used.

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.

Property Value

Type: System.Windows.SetterBaseCollection
The default value is null.

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. As mentioned above, adding a Setter child to a MultiTrigger object implicitly adds it to the SetterBaseCollection for the MultiTrigger object. Therefore, in the following example, <MultiTrigger.Setters> is implicit.

<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>

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft