私は 2 つのトリガー イベントを持っ<Trigger.EnterActions>
て<Trigger.ExitActions>
いIsPressed
ますIsMouseOver
。
ボタンをクリックすると、<Trigger Property="IsPressed" Value="True">
ストーリーボードが再生されます。
<Trigger Property="IsPressed" Value="True">
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource MouseDownTimeLine}"/>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource MouseUpTimeLine}"/>
</Trigger.ExitActions>
</Trigger>
これはこのストーリーボードにリンクされています:
<Storyboard x:Key="MouseDownTimeLine" >
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Pressed" Storyboard.TargetProperty="Opacity" >
<SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="MouseUpTimeLine">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Pressed" Storyboard.TargetProperty="Opacity" >
<SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
別のボタンも同じ Storyboard にリンクされています。2番目のボタンをクリックすると、ストーリーボードを再生したいのですが、最初のボタンは通常の状態に戻ります。ストーリーボードのこの部分です。
<Storyboard x:Key="MouseExitTimeLine">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Normal" Storyboard.TargetProperty="Opacity" >
<SplineDoubleKeyFrame KeyTime="00:00:00.00" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity" >
<SplineDoubleKeyFrame KeyTime="00:00:00.00" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
2番目のボタンがクリックされたときに、最初のボタンをトリガーして通常にリセットするにはどうすればよいですか