使用交互DataTrigger时故事板不会停止

时间:2015-02-17 20:27:39

标签: c# wpf

我正在尝试使用交互数据触发器来启动故事板。问题是故事板永远不会停止。有没有办法让它在运行一次后停止?

我的故事板:

    <Storyboard x:Key="DoorCloseStoryboard" SpeedRatio="2" Storyboard.TargetProperty="Source" 
                RepeatBehavior="1x" FillBehavior="Stop" Storyboard.TargetName="ChargeDoorImage">
        <ObjectAnimationUsingKeyFrames>
            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                <DiscreteObjectKeyFrame.Value>
                    <BitmapImage UriSource="/Mesabi.MixVision.Client.Wpf;component/Resources/Mixer/2/ChargeDoor/CDO.png"/>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
            <DiscreteObjectKeyFrame KeyTime="0:0:1">
                <DiscreteObjectKeyFrame.Value>
                    <BitmapImage UriSource="/Mesabi.MixVision.Client.Wpf;component/Resources/Mixer/2/ChargeDoor/CDMid.png"/>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
            <DiscreteObjectKeyFrame KeyTime="0:0:1.5">
                <DiscreteObjectKeyFrame.Value>
                    <BitmapImage UriSource="/Mesabi.MixVision.Client.Wpf;component/Resources/Mixer/2/ChargeDoor/CDC.png"/>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
    </Storyboard>

我的触发器:

<i:Interaction.Triggers>
    <ei:DataTrigger Binding="{Binding MixerInfo.IsInAuto}" Value="true">
        <ei:ControlStoryboardAction Storyboard="{StaticResource DoorCloseStoryboard}" ControlStoryboardOption="Play" />
    </ei:DataTrigger>
</i:Interaction.Triggers>

0 个答案:

没有答案
相关问题