Binding the VisualStateManager to a property

  • Gérald Barré

Here is a little trick to bind a ViewModel property to a VisualStateManager state. For this we use the Triggers and the GoToStateAction TriggerAction

  <ei:DataTrigger Binding="{Binding Model.Prop}" Value="Value1">
    <ei:GoToStateAction StateName="State1"/>
  <ei:DataTrigger Binding="{Binding Model.Prop}" Value="Value2">
    <ei:GoToStateAction StateName="State2"/>

Do you have a question or a suggestion about this post? Contact me!

Follow me:
Enjoy this blog?Buy Me A Coffee💖 Sponsor on GitHub