cro*_*oxy 3 c# animation xaml uwp
我正在尝试Ellipse在XAML 中为元素的width和height属性设置动画.我在网上找到了一些例子,但似乎都没有.
我敢肯定我只缺少一点点愚蠢的东西.这是我在xaml中的动画:
<Page.Resources>
<Storyboard x:Name="PressFormLogin" Storyboard.TargetName="OuterEllipse">
<DoubleAnimation Storyboard.TargetProperty="Width" From="259.0" To="149.0" Duration="0:0:5" />
<DoubleAnimation Storyboard.TargetProperty="Height" From="259.0" To="149.0" Duration="0:0:5" />
</Storyboard>
</Page.Ressources>
Run Code Online (Sandbox Code Playgroud)
EllipseXAML中的元素:
<Ellipse x:Name="OuterEllipse" Width="259" Height="259" Fill="#FF5AA1BA" />
Run Code Online (Sandbox Code Playgroud)
我如何尝试在后面的代码中启动动画:
PressFormLogin.Begin();
Run Code Online (Sandbox Code Playgroud)
这是我第一次在我的一个应用程序中使用动画,如果有人能给我推进正确的方向,那就太好了.
尝试EnableDependentAnimation="True"为你的设置DoubleAnimation.请参阅MSDN上的EnableDependentAnimation.