FirelyTeam / firely-net-sdk

The official Firely .NET SDK for HL7 FHIR
Other
829 stars 345 forks source link

INotifyPropertyChanged work chained back to the parent resource? #1406

Open jackliums opened 4 years ago

jackliums commented 4 years ago

I am trying to use INotifyPropertyChanged to detect when a property value has changed. For non-collection type property, this works fine but for anything that's exposed as List or IEnumerable, it seems like the property changed event only happens if the entire collection is replaced. Also, the parent resource does not subscribe to child object changes (e.g., Patient resource will only fire change event if the entire Name list is set to a new instance. Adding a new name or modifying an existing name will not trigger change event).

Is this intentional? I think it would be really useful to say given a resource, notify me when any of the sub property including the list content changes.

brianpos commented 4 years ago

That is correct, we don't use ObservableCollections, we use simple lists.

ewoutkramer commented 4 years ago

Should we use ObservableCollections? Is that expensive, performance-wise?

mmsmits commented 6 months ago

We need IList (or something similar) on Poco's for this to use other collection types.

mmsmits commented 4 months ago

We'll plan this for SDK 6.0