Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-971

Detecting ISet<> and IList<> member changes

      What happened?

      ISet<> and IList<> membership changes used to produce a PropertyChanged notification. This no longer happens (as of about v10.20 ish, maybe earlier). This happens with both local and sync.

      1. Was this intentional?

      The documentation pages ( https://www.mongodb.com/docs/realm/sdk/dotnet/model-data/data-types/collections/ and https://www.mongodb.com/docs/realm/sdk/dotnet/model-data/data-types/sets/ ) say fields of these collection types implement INotifyCollectionChanged. The C# properties, declared as ISet<> and IList<>, do not actually include this interface. BUT fortunately, it does actually work, if the field is cast as INotifyCollectionChanged.

      1. Should the documentation or the listed interfaces be updated to indicate how to do this? (This would have saved me some time trying to work out what was going on and how to fix it.)

      Repro steps

      1. Define a RealmObject with an ISet<string> or IList<string> field.
      2. Register a PropertyChanged event listener.
      3. Add a set member in a write transaction.
      4. See whether event listener is triggered.

      Version

      10.21.1

      What Atlas Services are you using?

      Atlas Device Sync

      What type of application is this?

      WPF

      Client OS and version

      Windows 10 22H2 22621.1555

      Code snippets

      RealmTest.zip

      Stacktrace of the exception/crash you're getting

      No response

      Relevant log output

      No response

            Assignee:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: