Reputation: 4332
Just this. I want that when the databound property Text of a TextBlock for example changes, an animation is performed to give some feedback to the user. How can this be done?? thanks!
Upvotes: 1
Views: 508
Reputation: 4332
I found a way to do it using a PropertyChangedTrigger
<Interactivity:Interaction.Triggers>
<ec:PropertyChangedTrigger Binding="{Binding KnownMeaning}" >
<eim:ControlStoryboardAction Storyboard="StaticResource Storyboard2}"/>
</ec:PropertyChangedTrigger>
</Interactivity:Interaction.Triggers>
There may be a more elegant solution, but I think this is pretty straightforward
Upvotes: 5
Reputation: 5134
You can simply add event to ViewModel and start animation (Storyboard.Begin) in code-behind. Or even do it without extra event by adding handler of ViewModel.PropertyChanged in code-behind.
More advanced options are listed here: Re: How to Annimate (Storyboard.Begin() ) in MVVM.
Upvotes: 1