怎么动不起来,初学者
wpf吧
全部回复
仅看楼主
level 5
<Window x:Class="Animation_Using_KeyFrames.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Animation_Using_KeyFrames"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Canvas>
<Ellipse Fill="Red" Canvas.Top="0" Canvas.Left="0" Width="84" Height="50" >
<Ellipse.RenderTransform>
<TranslateTransform X="100" Y="100" x:Name="ellipseMove" />
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded">
<BeginStoryboard>
<Storyboard>
<PointAnimationUsingKeyFrames Storyboard.TargetName="MyEllise"
Storyboard.TargetProperty="Center" RepeatBehavior="Forever" >
<LinearPointKeyFrame KeyTime="00:00:00" Value="50,50"/>
<LinearPointKeyFrame KeyTime="00:00:01" Value="100,50"/>
<LinearPointKeyFrame KeyTime="00:00:02" Value="100,100"/>
<LinearPointKeyFrame KeyTime="00:00:03" Value="50,100"/>
<LinearPointKeyFrame KeyTime="00:00:04" Value="50,50"/>
</PointAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
</Canvas>
</Grid>
</Window>
2018年03月23日 14点03分 1
level 11
LinearPointKeyFrame没有TargetName[汗]
2018年04月01日 01点04分 2
1