StopStoryboard shows animation warning
I have defined two animations in the datatemplate for a grid cell.
<DataTemplate.Resources>
<Storyboard x:Key="ShowMenuStory">
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Menu" Storyboard.TargetProperty="IsOpen">
<!-- in two seconds the popup is opened -->
<DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:2.0" />
</BooleanAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="HideMenuStory">
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Menu" Storyboard.TargetProperty="IsOpen">
<!-- immediately poup is closed -->
<DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:0.1" />
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</DataTemplate.Resources>
In DataTemplate.Triggers try to manipulate my storyboards like this:
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsFocused, ElementName=PART_Editor}" Value="True">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="HideStory" />
<BeginStoryboard Name="ShowStory" Storyboard="{StaticResource ShowMenuStory}" />
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<StopStoryboard BeginStoryboardName="ShowStory" />
<BeginStoryboard Name="HideStory" Storyboard="{StaticResource HideMenuStory}" />
</DataTrigger.ExitActions>
</DataTrigger>
</DataTemplate.Triggers>
The problem is that when I focus the camera, I will first try to stop the animation (HideStory) that hasn't been done yet. This raises the following warning:
System.Windows.Media.Animation Warning: 6: Unable to take action because the specified Storyboard has never been applied to this object for interactive control; Action = "Delete"; ...
Do you know how I can avoid this warning in xaml? Thanks to
+3
source to share
No one has answered this question yet
Check out similar questions: