I have a Control that I wish to go to update it’s VisualState when an Event (get/lose focus) is fired. I have typically achieved this with an EventTrigger.
However this time… when the event is raised I only want it to change VisualState if a condition is true.
Is this easily achieved in Silverlight 4.0?
With AttachedBehaviors you can achieve this pretty easily. You would just create an attached property bound to some property that changes (IsFocused for example) and in the OnPropertyChangedEvent, you can check your condition and continue to change the VisualState as needed.
For more on AttachedBehaviors, go here