Crash when trying to attach command to storyboard completed event [Managed SDK version 2.2.4]
Posted: 22 Sep 2019, 11:50
First I tried it this way, as per another forum post I saw:
But during the xaml parsing, the debug claims it cannot find EventToCommand.
So then I tried what I thought was the newer approach:
But this crashes at runtime here:
Any ideas?
Code: Select all
<UserControl x:Class="Controls.SoftButton.SoftButtonControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Controls.SoftButton"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:noesis="clr-namespace:NoesisGUIExtensions">
<UserControl.Resources>
<Storyboard x:Key="MenuItemLoad" noesis:EventToCommand.Event="Completed" noesis:EventToCommand.Command="{Binding SbUnloadStoryboardCommand}">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="MenuItemBorder">
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="90"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
...
So then I tried what I thought was the newer approach:
Code: Select all
<Storyboard x:Key="MenuItemLoad">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Completed">
<i:InvokeCommandAction Command="{Binding SbLoadStoryboardCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="MenuItemBorder">
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="90"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
Code: Select all
GUI.LoadComponent(this, "Controls.SoftButton.SoftButtonControl.xaml");