gpt4 book ai didi

c# - 如何在 UWP 应用程序中为椭圆的宽度和高度设置动画

转载 作者:行者123 更新时间:2023-11-30 14:27:09 24 4
gpt4 key购买 nike

我正在尝试为 XAML 中的 Ellipse 元素的宽度和高度属性设置动画。我在网上找了几个例子,但似乎都行不通。
我确定我只缺少一些小而愚蠢的东西。这是我在 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>

XAML 中的 Ellipse 元素:

<Ellipse x:Name="OuterEllipse"  Width="259" Height="259" Fill="#FF5AA1BA" />

以及我如何尝试在后面的代码中启动动画:

PressFormLogin.Begin();

这是我第一次在我的一个应用程序中使用动画,如果有人能在正确的方向上插入我,那就太好了。

最佳答案

尝试为您的 DoubleAnimation 设置 EnableDependentAnimation="True"。参见 EnableDependentAnimation on MSDN .

关于c# - 如何在 UWP 应用程序中为椭圆的宽度和高度设置动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33647598/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com