Skip to content

Instantly share code, notes, and snippets.

@iamrommel
Created September 16, 2013 03:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save iamrommel/6576374 to your computer and use it in GitHub Desktop.
Save iamrommel/6576374 to your computer and use it in GitHub Desktop.
On collection changed, trap the added item and put some logic and set value for it
partial void Plants_Changed(NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
var addedItem = e.NewItems[0] as HaulerPlant;
if (addedItem == null) return;
addedItem.IsActive = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment