0
我已經寫了靜態動畫動態DoubleAnimationUsingKeyFrames與DoubleAnimationUsingKeyFrames
:如何編寫C#和XAML
<Storyboard x:Name="MyCount" Completed="MyCount_Completed">
<DoubleAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetName="MyProgressBar" Storyboard.TargetProperty="(RangeBase.Value)">
<DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="100"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:1" Value="90"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:2" Value="80"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:3" Value="70"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:4" Value="60"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:5" Value="50"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="40"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:7" Value="30"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:8" Value="20"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:9" Value="10"/>
<DiscreteDoubleKeyFrame KeyTime="0:0:10" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
現在我喜歡做這個代碼(價值和時間部分),動態與C#。 我該怎麼做?
如果是UWP你也可以使用「X:綁定」,而不是綁定這是強類型的,有Intellisense據說具有更好的性能。 –