Skip to content
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

IList does not update UWP ListView #1883

Closed
duncangroenewald opened this issue Jul 14, 2019 · 1 comment
Closed

IList does not update UWP ListView #1883

duncangroenewald opened this issue Jul 14, 2019 · 1 comment

Comments

@duncangroenewald
Copy link

duncangroenewald commented Jul 14, 2019

I am just converting and app from C#/WPF to C#/UWP (Windows 10) and it seems that IList does not update the UWP ListView.

So first question - should it ?

and if not then how should I bind the IList property to ensure the ListView will update if items are added or removed?

Maybe some more context - new items are getting created on a background thread - and the exact same method/code seems to work fine with C#/WPF.


<ListView x:Name="siteListView"  SelectionChanged="SiteListView_SelectionChanged" 
                             DataContext="{x:Bind _this}" 
ItemsSource="{x:Bind Customer.items, Mode=OneWay}"  >
...
public class Customer : RealmObject
    {
        [PrimaryKey]
        public string id { get; set; } = Guid.NewGuid().ToString();
        public string name { get; set; }

        public string address { get; set; }

        public string contact { get; set; }

        public float complianceScore { get; set; }
        public string completionStatus { get; set; }

        public IList<Site> sites { get; }

}
@nirinchev
Copy link
Member

This comment goes into a little bit of detail why this is happening: #1759 (comment). I'll close this as a duplicate of #1759.

@realm realm deleted a comment from realm-probot bot Jul 14, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants