Created
December 22, 2019 08:18
-
-
Save rotorgames/8210e771ae495d1880aa2719185be864 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
| public TestView : View | |
| { | |
| private static void OnItemSourceChanged(BindableObject bindable, object oldvalue, object newvalue) | |
| { | |
| var self = (TestView) bindable; | |
| var oldCollection = oldvalue as INotifyCollectionChanged; | |
| var newCollection = newvalue as INotifyCollectionChanged; | |
| if (oldCollection != null) | |
| oldCollection.CollectionChanged -= self.OnItemSourceCollectionChanged; | |
| if (newCollection != null) | |
| newCollection.CollectionChanged += self.OnItemSourceCollectionChanged; | |
| self.UpdateItems(); // your custom method | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment