-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Good practice in updating the collections #284
Comments
Hi, I agree that the update list logic in ViewState.cs could be improved. Would you like to take a stab at it and then send me a PR? |
Sure. :) |
BajakiGabesz
added a commit
to BajakiGabesz/dotNetify
that referenced
this issue
Mar 30, 2021
…he necessary properties when there's a real change.
BajakiGabesz
added a commit
to BajakiGabesz/dotNetify
that referenced
this issue
Mar 30, 2021
BajakiGabesz
added a commit
to BajakiGabesz/dotNetify
that referenced
this issue
Mar 30, 2021
…he necessary properties when there's a real change. (cherry picked from commit fd0ef5d)
BajakiGabesz
added a commit
to BajakiGabesz/dotNetify
that referenced
this issue
Mar 30, 2021
(cherry picked from commit 40f8d97)
Thanks for your merge! I close this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
It was a great pleasure to find dotNetify, it makes my life easier and I'm going to create a Xamarin application based on this, but I was faced with an issue and maybe I made something wrong.
So, anytime I just want to update a list item, on the screen the whole object updates, for example, I have a model with properties like Id, Name, ImageUrl, Description, inherited from ObservableObject.
It works fine, but a list element has been changed, even if it's only one property the whole item updates because in the ViewState.cs just removes and inserts the item in this case, which I think not the best efficient way to do:
_dispatcher.InvokeAsync(() => { listIface.Insert(i, newItem); listIface.RemoveAt(i + 1); });
I think it could be better if we can use Reflection here to only update properties which have been changed.
I just update the list in a next way:
this.UpdateList(nameof(FeaturedStories), GetNewsItem());
Am I able to get the information about the real changes or should I write it by myself?
The text was updated successfully, but these errors were encountered: