Search code examples
wpfsilverlightexpression-blend

MultiTrigger (checking more than one state) equivalent in VisualStateManager?


what is the equivalent of MultiTrigger option in visualStateManager? How will i check the below trigger in VisualStateManager in Blend or VS?

eg.

 <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Selector.IsSelected"
                                           Value="True" />
                                <Condition Property="IsMouseOver"
                                           Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter Property="StrokeThickness"
                                    TargetName="SelectedRectangle"
                                    Value="1" />
                        </MultiTrigger>

Any good tutorial available for VisualStateManager in Blend?


Solution

  • For most control templates these states are hardwired to the user interactions, so all you have to do is to create the animation in Blend for the right states.

    If you want to have the same looks for 2 different states then you have to duplicate it, but it's not recommended for several reasons. Most important ones being that users won't be sure which state is which and you'll potentially introduce some bugs. In your specific case I can tell you right now that even if IsSelected is true, if it's the same as MouseOver when you roll out of your control it'll go back to the normal state, so it won't look selected anymore.