Represents the base class for specifying a conditional value within a Style object.
Assembly: PresentationFramework (in PresentationFramework.dll)
Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited from DependencyObject.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Re-evaluates the effective value for the specified dependency property(Inherited from DependencyObject.)
Returns the local value of a dependency property, if it exists. (Inherited from DependencyObject.)
Sets the value of a dependency property without changing its value source. (Inherited from DependencyObject.)
Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.)
Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.(Inherited from DependencyObject.)
Returns a string that represents the current object.(Inherited from Object.)
The WPF styling and templating model allows you to specify triggers within your Style, ControlTemplate, and DataTemplate. Essentially, is the base class for objects that allow you to apply changes when certain conditions (such as when a certain property value becomes true, or when an event occurs) are satisfied.
The Trigger class is the simplest type of triggers. A Trigger object allows you to apply changes based on the value of a property. For example, the following example shows a named Style available to Button controls. The Style defines a Trigger element that changes the Foreground property of a button when the IsPressed property is true.
<Style x:Key="Triggers" TargetType="Button"> <Style.Triggers> <Trigger Property="IsPressed" Value="true"> <Setter Property = "Foreground" Value="Green"/> </Trigger> </Style.Triggers> </Style>
The EventTrigger class allows you to apply changes when an event occurs. The following example contains two EventTrigger objects, one of which occurs when the mouse enters the element and the other occurs when the mouse leaves the element.
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.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.