Hey guys,
This kind of differences between WPF and Silverlight is driving me nuts…
I am modifying the EventToCommand in MVVM Light to make it attachable to non FrameworkElement objects, such as Storyboard. The idea is to allow something like this:
<ResourceDictionary>
<Storyboard x:Name="MyStoryboard"
Storyboard.TargetName="TestEventToCommandWithStoryboardButton">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Completed">
<cmd:EventToCommand Command="{Binding Source={StaticResource Locator}, Path=Main.StoryboardCompletedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<DoubleAnimation Storyboard.TargetProperty="Opacity"
To="0"
Duration="0:0:2" />
</Storyboard>
</ResourceDictionary>
In Silverlight 3 and 4, this works great. The event is raised, the command is executed.
In WPF3.5 and 4, I get “Specified value of type 'System.Windows.Interactivity.EventTrigger' must have IsFrozen set to false to modify” when the storyboard is completed.
I thought it had to do with the fact that the Storyboard is in the resources but the same error occurs when it is created in code at runtime.
Is there any workaround?
Thanks,
Laurent
--
Laurent Bugnion
Director, UX Integration Development, IdentityMine
Microsoft MVP, MCP
www.galasoft.ch | blog.galasoft.ch