-
Notifications
You must be signed in to change notification settings - Fork 115
DataTriggerBehavior
Jon W Chu edited this page Nov 16, 2015
·
1 revision
DataTriggerBehavior performs an action when the data the behaviors is bound to meets a specified condition.
This Behavior listens for the specified Binding
object's to satisfy a certain ComparisionCondition
to Value
in order to execute.
Member Name | Description |
---|---|
Equal | Specifies an equal condition |
GreaterThan | Specifies a greater than condition |
GreaterThanOrEqual | Specifies a greater than or equal condition |
LessThan | Specifies a less than condition |
LessThanOrEqual | Specifies a less than or equal condition |
NotEqual | Specifies a not equal condition |
<Rectangle x:Name="DataTriggerRectangle">
<Interactivity:Interaction.Behaviors>
<Interactions:DataTriggerBehavior Binding="{Binding Value, ElementName=slider}" ComparisonCondition="GreaterThan" Value="50">
<Interactions:ChangePropertyAction TargetObject="{Binding ElementName=DataTriggerRectangle}" PropertyName="Fill" Value="{StaticResource PaleYellowBrush}"/>
</Interactions:DataTriggerBehavior>
<Interactions:DataTriggerBehavior Binding="{Binding Value, ElementName=slider}" ComparisonCondition="LessThanOrEqual" Value="50">
<Interactions:ChangePropertyAction TargetObject="{Binding ElementName=DataTriggerRectangle}" PropertyName="Fill" Value="{StaticResource RoyalBlueBrush}"/>
</Interactions:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</Rectangle>
- Introduction
- Using Behaviors NuGet
- Contribution
- API Reference
- Behaviors Reference
- Changelog