GoToStateAction on MultiDataTrigger
Is this something that's possible? I'm trying to refactor my BeginStoryboard set-up into visual states, but I can't add
to a MultiDataTrigger.EnterActions.
Is it possible to achieve a similar effect without using any code? With MultiDataTrigger s I can define states that are entered with as many conditions as I want all in XAML.
Would my only option be creating a custom control instead of a control template and adding a code-behind for it?
Code: Select all
<b:GoToStateAction StateName="SomeState"/>Is it possible to achieve a similar effect without using any code? With MultiDataTrigger s I can define states that are entered with as many conditions as I want all in XAML.
Would my only option be creating a custom control instead of a control template and adding a code-behind for it?
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: GoToStateAction on MultiDataTrigger
You can only use interactivity actions inside interactivity triggers, so instead of having a MultiDataTrigger in the template Triggers, you will have DataTrigger (or anything else you need) plus ConditionBehavior in an element of the visual tree:
Could you try that?
Code: Select all
<ControlTemplate ...>
<Grid>
<b:Interaction.Triggers>
<b:DataTrigger Binding="{Binding Something}" Value="True">
<b:Interaction.Behaviors>
<b:ConditionBehavior>
<b:ConditionalExpression ForwardChaining="And">
<b:ComparisonCondition LeftOperand="{Binding Count}" Operator="LessThan" RightOperand="0" />
<b:ComparisonCondition LeftOperand="{Binding Count}" Operator="GreaterThan" RightOperand="100" />
</b:ConditionalExpression>
</b:ConditionBehavior>
</b:Interaction.Behaviors>
<b:GoToStateAction StateName="SomeState"/>
</b:DataTrigger>
</b:Interaction.Triggers>
...
</Grid>
</ControlTemplate>Who is online
Users browsing this forum: No registered users and 2 guests