MVVM- Trigger Storyboard in the View Model in Silverlight
Posted
by user275561
on Stack Overflow
See other posts from Stack Overflow
or by user275561
Published on 2010-03-30T20:02:59Z
Indexed on
2010/03/30
20:13 UTC
Read the original article
Hit count: 1003
I have a couple of Storyboards in my view that I would like to trigger from the ViewModel if possible. Is there a simple way or elegant way of doing this. Here is what I am trying to do.
Person Clicks on a Button-->RelayCommand (In the ViewModel), the Relay Command should then play the storyboard. Also one more thing, I would like to also trigger the storyboard animation by itself in the ViewModel without any interaction.
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<cmd:EventToCommand Command="{Binding ButtonPress}" CommandParameterValue="RedButtonLight">
</cmd:EventToCommand>
</i:EventTrigger>
</i:Interaction.Triggers>
© Stack Overflow or respective owner