Created
September 16, 2013 03:15
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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