Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Trigger.Setters Property

Gets a collection of Setter objects, which describe the property values to apply when the specified condition has been 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

public SetterBaseCollection Setters { get; }
<object>
  <object.Setters>
    ZeroOrMoreSetters
  </object.Setters>
</object>

XAML Values

ZeroOrMoreSetters

Zero or more Setter objects. This does not support EventSetter object.

A Trigger allows you to use Setters to apply property values when the element meets a specified condition. For example, you may want to change the background color of an element when it is in focus.

If the same property is set more than once, the last property value will be applied.

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

Property Value

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

As mentioned above, adding a Setter child to a Trigger object implicitly adds it to the SetterBaseCollection for the Trigger object. In the following example, <Trigger.Setters> is implicit.

            <ControlTemplate.Triggers>
              <Trigger Property="IsSelected" Value="True">
		<Trigger.Setters>
                   <Setter Property="Opacity" Value="1.0" />
		</Trigger.Setters>
              </Trigger>
            </ControlTemplate.Triggers>

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft