-
Notifications
You must be signed in to change notification settings - Fork 140
ConditionBehavior
Brian Lagunas edited this page Apr 10, 2023
·
4 revisions
ConditionBehavior attaches to a trigger and controls the conditions on which to fire the actions.
This behavior blocks an action from occurring if the specified Condition
returns false.
<Button x:Name="Button">
<Behaviors:Interaction.Triggers>
<Behaviors:EventTrigger EventName="Click" SourceObject="{Binding ElementName=Button}">
<Behaviors:Interaction.Behaviors>
<Behaviors:ConditionBehavior>
<Behaviors:ConditionalExpression>
<Behaviors:ComparisonCondition LeftOperand="{Binding Path=Items.Count, ElementName=TabControl}" RightOperand="0" />
</Behaviors:ConditionalExpression>
</Behaviors:ConditionBehavior>
</Behaviors:Interaction.Behaviors>
<Behaviors:ChangePropertyAction TargetObject="{Binding ElementName=DataTriggerRectangle}" PropertyName="Fill" Value="LightYellow"/>
</Behaviors:EventTrigger>
</Behaviors:Interaction.Triggers>
</Button>
- Introduction
- Contribution
- Behaviors Reference
- CallMethodAction
- ChangePropertyAction
- ConditionBehavior
- ControlStoryboardAction
- DataStateBehavior
- FluidMoveBehavior
- FluidMoveSetTagBehavior
- GoToStateAction
- InvokeCommandAction
- LaunchUriOrFileAction
- MouseDragElementBehavior
- PlaySoundAction
- RemoveElementAction
- SetDataStoreValueAction
- TranslateZoomRotateBehavior