EventToCommand on Storyboard?

May 7, 2010 at 11:23 PM

It would be magical if I could use EventToCommand on a storyboard completed event.

I tried and this and received exception.

--Cannot attach type "EventToCommand" to type "Storyboard". Instances of type "EventToCommand" can only be attached to objects of type "FrameworkElement".

Is there any way to achieve this with some other type of xaml configuration?

Here's what I'm trying:

<Storyboard >
    <i:Interaction.Triggers>
    	<i:EventTrigger EventName="Completed">
    		<GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding MyCommand}" PassEventArgsToCommand="True"/>
    	</i:EventTrigger>
    </i:Interaction.Triggers>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid">
    	<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
</Storyboard>

I just want to send a command on a Completed event from a Storyboard...

Coordinator
May 21, 2010 at 10:05 AM

Hi,

Sorry for the delay. This is an interesting idea. Off the top of my mind, it should work, but I need to look into it. I opened an item in my backlog.

Cheers,

Laurent

Aug 24, 2010 at 8:14 PM

I looked in the issues list and didn't see it (perhaps your backlog isn't public?), so I added this item: http://mvvmlight.codeplex.com/workitem/6979