PatrickSCLin
PatrickSCLin

Reputation: 1449

TextBlock FontSize Animation not work with Duration in Xaml in Visual Studio 2015

I just create a C# Windows Universal App Project (Visual Studio 2015),

It works fine with

<DoubleAnimation Duration="00:00:01" To="0" Storyboard.TargetName="mainTextBlock" Storyboard.TargetProperty="Opacity"/>

but this doesn't

<DoubleAnimation Duration="00:00:01" To="0" Storyboard.TargetName="mainTextBlock" Storyboard.TargetProperty="FontSize"/>

only works when I set the duration to 0

<DoubleAnimation Duration="00:00:00" To="0" Storyboard.TargetName="mainTextBlock" Storyboard.TargetProperty="FontSize"/>

but I read some tutorial, they set duration for changing font size, so what I miss ?

Upvotes: 0

Views: 748

Answers (1)

PatrickSCLin
PatrickSCLin

Reputation: 1449

I found the solution,

needs to add property

EnableDependentAnimation="True"

<DoubleAnimation Duration="00:00:01" To="0" 
EnableDependentAnimation="True" 
Storyboard.TargetName="mainTextBlock" Storyboard.TargetProperty="FontSize"/>

Upvotes: 4

Related Questions