【发布时间】:2009-06-15 11:42:56
【问题描述】:
举个简单的例子,如果你有一个像下面这样动态创建它的内容的 ItemsControl 我如何添加触发器,以便每个项目在列表中动画并具有一个 BeginTime 基于它在列表中的索引。
我已经尝试扩展按钮,使其包含延迟时间,然后绑定按钮 ControlTemplate 的触发器中包含的动画的 BeginTime,因为动画可冻结而存在问题。
如何在 ItemsControl 本身或单个项目上创建一个情节提要,逐个显示每个项目。
有什么想法吗?
我的标记的起点:
<Window.Resources>
<ResourceDictionary >
<Collections:ArrayList x:Key="ItemsList">
<System:String>OPTIONS</System:String>
<System:String>STICKERS</System:String>
<System:String>STYLING</System:String>
<System:String>WHEELS</System:String>
<System:String>INTERIOR</System:String>
<System:String>ROOF</System:String>
<System:String>COLOURS</System:String>
<System:String>VERSION</System:String>
</Collections:ArrayList>
</ResourceDictionary>
</Window.Resources>
<Grid>
<ListView ItemsSource="{StaticResource ItemsList}">
<ListView.Style>
<Style>
<Setter Property="ListView.ItemTemplate">
<Setter.Value>
<DataTemplate>
<Button Content="{Binding}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.Style>
</ListView>
</Grid>
干杯 J
【问题讨论】: