How can I trigger a Command in my ViewModel at the end of an animation/storyboard using XAML only.
A:
You can create Command property in your Model and manually execute command on Animmiation Completed event
ArsenMkrt
2009-10-09 11:02:56
I suppose this can be done in XAML only using eventtriggers?
bitbonk
2009-10-09 11:04:36
Yea, I think because Annimation classes don't have any command property
ArsenMkrt
2009-10-09 11:08:46
I can register for the event in a trigger but I can not start the command in a trigger. At least I dont't see how.
bitbonk
2009-10-09 11:14:08
do you have command property in model? if(model.command.CanExecute) model.Command.Execute(...);
ArsenMkrt
2009-10-09 11:19:28
I have that in the VIEWModel yes.
bitbonk
2009-10-09 15:04:51
then you can execute it manually as I mentioned in last comment
ArsenMkrt
2009-10-09 15:29:44
Yes but how do I wire up the AnimationCompleted Event with my ViewModel. I would not want to do it in the code behind. That's why I said "xaml only".
bitbonk
2009-10-11 10:06:52
sometimes you should write some glue code in code behind,if it is not breaking model's testing functionality of course, not every requirement is possible to implement only with binding, for example when you want to show message box to verify user choice the better place to do that is code behind
ArsenMkrt
2009-10-11 18:03:40