<Storyboard x:Key="CloseContentGrid">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Height" Storyboard.TargetName="ContentGrid">
<EasingDoubleKeyFrame KeyTime="0" Value="100"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
我想使用此动画将网格的Height
从ActualHeight(100)
更改为Zero
答案 0 :(得分:0)
你可以试试这个:
DoubleAnimation animation = new DoubleAnimation(100,0, new Duration(TimeSpan.FromMilliseconds(800)));
ContentGrid.BeginAnimation(HeightProperty, animation);