Skip to content

Instantly share code, notes, and snippets.

@rkusa
Created October 9, 2010 01:27
Show Gist options
  • Save rkusa/617785 to your computer and use it in GitHub Desktop.
Save rkusa/617785 to your computer and use it in GitHub Desktop.
private void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
{
Dispatcher.BeginInvoke(new ItemAddedDelegate(i =>
{
var item = (ListBoxItem) MainListBox.ItemContainerGenerator.ContainerFromIndex(i - 1);
if (item == null)
return;
VisualStateManager.GoToState(item, "BeforeLoaded", false);
item.Opacity = 1.0;
VisualStateManager.GoToState(item, "AfterLoaded", true);
}), MainListBox.Items.Count);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment