croxy croxy - 20 days ago 7x
C# Question

How to animate the width and height of an ellipse in an UWP app

I'm trying to animate the width and height property of an

element in XAML. I found a few examples online, but none of them seems to work.

I'm sure I'm missing only something little and stupid. Here my animation in xaml:

<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" />

element in XAML:

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

And how I try to start the animation in the code behind:


It's the first time that I'm using a animation in one of my applications, it would be nice if someone could give me a push in the right direction.


Try to set EnableDependentAnimation="True" for your DoubleAnimation. See EnableDependentAnimation on MSDN.