I created a Textbox Template as well as states for it. The states are mainly there so that I can use storyboards to display / hide visual elements.
For example, I have an “Error” States Group, which has transitions such as “New Errors” and “No Errors”.
I also have triggers that check if the control’s “Validate.HasError” is set to “True” or “False”.
I would like to change my control’s state by using these triggers, so that I can play the right animation whenever the control fails validation.
In other words, can I change the control’s state to “New Errors” or “No Errors” by using these triggers ?
I would preferably like to change the states without having to use code-behind (i.e.: VisualStateManager.GoToState(…))
Instead of using states, I simply assigned different storyboards when the Trigger’s actions get activated or deactivated: