Created
April 4, 2011 22:41
-
-
Save anaisbetts/902622 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // This is the WPF/Silverlight ObservableCollection, not from Rx at all! | |
| ObservableCollection<MyCoolModel> modelCollection; | |
| model.Length | |
| >>> 4 | |
| // Create a View Model Collection that will track the Model collection | |
| var viewModelCollection = modelCollection.CreateDerivedCollection( | |
| x => new MyCoolViewModel(x)); | |
| viewModelCollection.Length | |
| >>> 4 | |
| // Now, changes to modelCollection are mirrored in viewModelCollection | |
| modelCollection.Add(new MyCoolModel()); | |
| viewModelCollection.Length | |
| >>> 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment