MouseLeaveで、次のアニメーションがちらつき、動かないのはなぜですか?再編集できる場合は、スクリーンキャストを投稿します。WPF Path Animationがちらつくのはなぜですか?
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Canvas>
<Path Fill="Blue" Margin="15,15,15,15">
<Path.Data>
<!-- Describes an ellipse. -->
<EllipseGeometry x:Name="MyAnimatedEllipseGeometry" Center="200,100" RadiusX="15" RadiusY="15" />
</Path.Data>
<Path.Triggers>
<EventTrigger RoutedEvent="UIElement.MouseEnter">
<BeginStoryboard>
<Storyboard Duration="0:0:.5">
<DoubleAnimation Storyboard.TargetName="MyAnimatedEllipseGeometry"
Storyboard.TargetProperty="RadiusX"
From="15" To="100" />
<DoubleAnimation Storyboard.TargetName="MyAnimatedEllipseGeometry"
Storyboard.TargetProperty="RadiusY"
From="15" To="100" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="UIElement.MouseLeave">
<BeginStoryboard>
<Storyboard Duration="0:0:.5">
<DoubleAnimation Storyboard.TargetName="MyAnimatedEllipseGeometry"
Storyboard.TargetProperty="RadiusX"
From="100" To="15" />
<DoubleAnimation Storyboard.TargetName="MyAnimatedEllipseGeometry"
Storyboard.TargetProperty="RadiusY"
From="100" To="15" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Path.Triggers>
</Path>
</Canvas>
</Page>
ありがとうございました。それはとてもうまくいった。ストーリーボードの期間とDoubleAnimationの期間の設定の違いを教えてください。 –
以上、Storyboard.DurationをDoubleAnimation.Durationと設定する必要がある場合 –
ストーリーボード全体にRepeatBehaviorが設定されている場合がほとんどですが、Durationを使用して特定の時間間隔でリセットできます。 –