我想通过将Border
Height
的Height
从0
调整为50
来为其设置动画。
这是我尝试过的:
<Storyboard x:Key="showAnimation">
<ThicknessAnimation Storyboard.TargetProperty="Height"
From="0" To="50"
DecelerationRatio=".9"
Duration="0:0:1" />
</Storyboard>
并得到了这个错误:
高度动画:''System.Windows.Media.Animation.ThicknessAnimation‘动画对象不能用于为属性“
”设置动画,因为它属于不兼容的类型“System.Double”。“
发布于 2018-07-14 03:00:39
将ThicknessAnimation替换为DoubleAnimation,因为高度是双精度的,而不是厚度
<Storyboard x:Key="showAnimation">
<DoubleAnimation Storyboard.TargetProperty="Height"
From="0" To="50"
DecelerationRatio=".9"
Duration="0:0:1" />
</Storyboard>
https://stackoverflow.com/questions/51331331
复制相似问题