WPF中一个小动画德实现
有一个lisbox,里面模板列中是小风扇图标,怎么让小风扇转起来?
<ListBox Grid.Row="1" Margin="-20,0,0,0" Name="LboxStoreHouses" BorderThickness="0" ItemsSource="{Binding List}" Background="Transparent">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<ComUc:AnimatingTilePanel ItemHeight="90" ItemWidth="150"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Canvas x:Name="CanvasName" Cursor="Hand" HorizontalAlignment="Left" Margin="2,0.5,0,0" Width="117" Height="100" VerticalAlignment="Top" d:LayoutOverrides="Height">
<Image x:Name="FS" Height="8" Width="9" Canvas.Left="78" Canvas.Top="40" RenderTransformOrigin="0.5,0.5" Source="../Images/Shanzi.png" Visibility="Visible" >
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Canvas>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
[解决办法]
“感觉 Storyboard.TargetName="FS"就不行了吧”,为什么感觉不行?试了没?
[解决办法]
DataTemplate.Triggers —— EventTrigger —— Storyboard