Почему Повторить Поведение не работает для моей доски объявлений? - PullRequest
0 голосов
/ 18 февраля 2019

Я хочу, чтобы моя раскадровка начиналась снова и снова, поэтому я установил Повторить поведение = "Навсегда", но раскадровка не запустилась снова.

Я пытаюсь поместить storyboard.completed, но отладчик никогда не входит в это событие, почему раскадровкане заканчивается, я не установил Поведение повтора для какого-либо движения больше, чем 1

моя раскадровка:

<Storyboard x:Key="napton" RepeatBehavior="Forever">
    <DoubleAnimationUsingPath Duration="0:0:3" Source="X" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="napton" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M351.5,142 L241,142"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <DoubleAnimationUsingPath Duration="0:0:3" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="napton" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M351.5,142 L241,142"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <DoubleAnimationUsingPath Duration="0:0:3" Source="Angle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="napton" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M351.5,142 L241,142"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="napton" RepeatBehavior="1x">
        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:3" Value="{x:Static Visibility.Hidden}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:12" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <DoubleAnimationUsingPath BeginTime="0:0:3" Duration="0:0:2" Source="X" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="napton_back" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M526,134.5 L636.5,134.5"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <DoubleAnimationUsingPath BeginTime="0:0:3" Duration="0:0:2" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="napton_back" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M526,134.5 L636.5,134.5"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="napton_back" RepeatBehavior="1x">
        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:3" Value="{x:Static Visibility.Visible}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:5" Value="{x:Static Visibility.Hidden}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:12" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <DoubleAnimationUsingPath BeginTime="0:0:5" Duration="0:0:7" Source="X" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="napton_orbit" RepeatBehavior="1x" Completed="Storyboard_
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M636,140.25 C636,237.31404 525.07855,316 388.25,316 C251.42145,316 140.5,237.31404 140.5,140.25 C140.5,43.185955 251.42145,-35.5 388.25,-35.5 C525.07855,-35.5 636,43.185955 636,140.25 z"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <DoubleAnimationUsingPath BeginTime="0:0:5" Duration="0:0:7" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="napton_orbit" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M636,140.25 C636,237.31404 525.07855,316 388.25,316 C251.42145,316 140.5,237.31404 140.5,140.25 C140.5,43.185955 251.42145,-35.5 388.25,-35.5 C525.07855,-35.5 636,43.185955 636,140.25 z"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="napton_orbit" RepeatBehavior="1x">
        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:5" Value="{x:Static Visibility.Visible}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:12" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="napton_orbit" RepeatBehavior="1x">
        <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
        <EasingDoubleKeyFrame KeyTime="0:0:5" Value="1"/>
        <EasingDoubleKeyFrame KeyTime="0:0:6.7" Value="1.5"/>
        <EasingDoubleKeyFrame KeyTime="0:0:8.5" Value="1"/>
        <EasingDoubleKeyFrame KeyTime="0:0:10.3" Value="0.5"/>
        <EasingDoubleKeyFrame KeyTime="0:0:12" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="napton_orbit" RepeatBehavior="1x">
        <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
        <EasingDoubleKeyFrame KeyTime="0:0:5" Value="1"/>
        <EasingDoubleKeyFrame KeyTime="0:0:6.7" Value="1.5"/>
        <EasingDoubleKeyFrame KeyTime="0:0:8.5" Value="1"/>
        <EasingDoubleKeyFrame KeyTime="0:0:10.3" Value="0.5"/>
        <EasingDoubleKeyFrame KeyTime="0:0:12" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingPath BeginTime="0:0:5" Duration="0:0:2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="sun" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M2,-0.25 L104,1.25"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <DoubleAnimationUsingPath BeginTime="0:0:5" Duration="0:0:2" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="sun" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M2,-0.25 L104,1.25"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="sun" RepeatBehavior="1x">
        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:5" Value="{x:Static Visibility.Visible}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:7" Value="{x:Static Visibility.Hidden}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:12">
            <DiscreteObjectKeyFrame.Value>
                <Visibility>Hidden</Visibility>
            </DiscreteObjectKeyFrame.Value>
        </DiscreteObjectKeyFrame>
    </ObjectAnimationUsingKeyFrames>
    <DoubleAnimationUsingPath BeginTime="0:0:7" Duration="0:0:2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="sun_l" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M102.5,1.25 L-98.5,1.25"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <DoubleAnimationUsingPath BeginTime="0:0:7" Duration="0:0:2" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="sun_l" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M102.5,1.25 L-98.5,1.25"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="sun_l" RepeatBehavior="1x">
        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:7" Value="{x:Static Visibility.Visible}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:9" Value="{x:Static Visibility.Hidden}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:10">
            <DiscreteObjectKeyFrame.Value>
                <Visibility>Hidden</Visibility>
            </DiscreteObjectKeyFrame.Value>
        </DiscreteObjectKeyFrame>
        <DiscreteObjectKeyFrame KeyTime="0:0:12" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <DoubleAnimationUsingPath BeginTime="0:0:9" Duration="0:0:3" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="sun_back" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M-100,-0.25 L3.5,-0.25"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <DoubleAnimationUsingPath BeginTime="0:0:9" Duration="0:0:3" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="sun_back" RepeatBehavior="1x">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M-100,-0.25 L3.5,-0.25"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="sun_back" RepeatBehavior="1x">
        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:9" Value="{x:Static Visibility.Visible}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:12">
            <DiscreteObjectKeyFrame.Value>
                <Visibility>Visible</Visibility>
            </DiscreteObjectKeyFrame.Value>
        </DiscreteObjectKeyFrame>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(TileBrush.TileMode)" Storyboard.TargetName="napton" RepeatBehavior="1x">
        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static TileMode.None}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:0.6" Value="{x:Static TileMode.None}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:3" Value="{x:Static TileMode.None}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(TileBrush.Stretch)" Storyboard.TargetName="napton" RepeatBehavior="1x">
        <DiscreteObjectKeyFrame KeyTime="0:0:3" Value="{x:Static Stretch.Uniform}"/>
        <DiscreteObjectKeyFrame KeyTime="0:0:12" Value="{x:Static Stretch.UniformToFill}"/>
    </ObjectAnimationUsingKeyFrames>
    <DoubleAnimationUsingPath BeginTime="0:0:5" Duration="0:0:2" Source="Angle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="sun" RepeatBehavior="Forever">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M2,-0.25 L104,1.25"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
</Storyboard>

результат, который я хочу получить, это сделать цикл раскадровки или узнать, почему раскадровка неокончание

1 Ответ

0 голосов
/ 20 февраля 2019

Проблема, с которой вы столкнулись, заключается в том, что для финальной анимации DoubleAnimationUsingPath задано значение RepeatBehavior="Forever", поэтому анимация никогда не закончится, и, следовательно, Storyboard.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...