Say I have a StackPanel with a few items in it. When I load my view, I want to apply some animation to them. But I want each item to animate in sequence, one after the other. How would I go about doing this? In particular, is there a clean way to do this in an MVVM framework?
Edit - I should mention that the items are databound to the StackPanel through an ItemsControl, which might make things substantially more difficult. It looks like this
<ItemsControl x:Name="Items">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Content="{Binding ButtonName}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Some UI code omitted for clarity.
Copy/Paste/Compile/Run : I'd throw an explanation but too many topics to cover. Basically the sample shows how to MultiTrigger, Animate, Load Items in the Background without freezing UI and use of PropertyChanged to notify UI. Enjoy.
Here's the XAML
Then here's the code behind for it: