我有ListView
我想根据属性更改使用GridViewColumn
更改其animation
的宽度。
这就是我尝试过的(属性实现INotifyPropertyChanged
并更改了它的值):
<ListView>
<ListView.View>
<GridView>
<GridViewColumn Header="Select" Width="0">
<GridViewColumn.CellTemplate>
<DataTemplate>
<DataTemplate.Resources>
<DataTrigger x:Key="ee" Binding="{Binding Path=IsTrue}" Value="True">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="EndAnimation"/>
<BeginStoryboard Name="NewAnimation">
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Width"
From="0"
To="50"
DecelerationRatio=".9"
Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger x:Key="ee1" Binding="{Binding Path=IsTrue}" Value="False">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="NewAnimation"/>
<BeginStoryboard Name="EndAnimation">
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Width"
From="50"
To="0"
DecelerationRatio=".9"
Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</DataTemplate.Resources>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
因此,尽管property
当前发生了变化,但我看不到宽度发生了变化。
有什么建议吗?