Reputation: 16320
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="00:00:00.1000000"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal">
</VisualState>
<VisualState x:Name="Focused">
</VisualState>
<VisualState x:Name="Pressed">
</VisualState>
<VisualState x:Name="MouseOver">
</VisualState>
<VisualState x:Name="Selected">
</VisualState>
</VisualStateGroup>
I have xaml as above i am programmatically applying Selected state by using VisualStateManager.GoToState and after applying it again i do mouse over it then it applies MouseOver styles How do i prevent overriding of style?
Upvotes: 0
Views: 894
Reputation: 1030
if you want separate viewstates you have to separate them into separate visualstategroups. Any Visual state in the same visualstate group can override any other visual state in the same group.
So if you dont want mouseover to override selected you have to put them in separate groups.
Upvotes: 2