我有一个 ListView 占用 Grid 的单元格:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ListView
x:Name="itemListView"
Grid.Column="0"
Grid.ColumnSpan="2"
/>
</Grid>
我想在 Storyboard 中更改 colspan:
<VisualState x:Name="Snapped">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="itemListView"
Storyboard.TargetProperty="Grid.ColumnSpan">
<DiscreteObjectKeyFrame KeyTime="0" Value="1" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
但它最终出现运行时错误......