Ali*_*lin 5 wpf grid binding row storyboard
我有Grid2 行:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="150"/>
<RowDefinition />
<RowDefinition Height="Auto" x:Name="OtherContactsRow" />
</Grid.RowDefinitions>
Something here
</Grid>
Run Code Online (Sandbox Code Playgroud)
和 2Storyboard秒:
<Storyboard x:Key="MaximizedStoryboard">
<DoubleAnimation From="20" To="150" Duration="0:0:2"
Storyboard.TargetName="OtherContactsRow"
Storyboard.TargetProperty="Height" >
</DoubleAnimation>
</Storyboard>
<Storyboard x:Key="MinimizedStoryboard">
<DoubleAnimation From="150" To="20" Duration="0:0:2"
Storyboard.TargetName="OtherContactsRow"
Storyboard.TargetProperty="Height">
</DoubleAnimation>
</Storyboard>
Run Code Online (Sandbox Code Playgroud)
当我尝试修改名为的行的高度时,OtherContactsRow收到以下错误:
'System.Windows.Media.Animation.DoubleAnimation' animation object cannot be used to animate property 'Height' because it is of incompatible type 'System.Windows.GridLength'.
任何解决方案?
Jam*_*sey -3
你可以试试这个ActualHeight楼盘。它是一个double。
| 归档时间: |
|
| 查看次数: |
7658 次 |
| 最近记录: |