-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
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.
- 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.
- 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
- Define a RealmObject with an ISet<string> or IList<string> field.
- Register a PropertyChanged event listener.
- Add a set member in a write transaction.
- 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
Stacktrace of the exception/crash you're getting
No response
Relevant log output
No response