There's a use case for showing properties of multiple data sources (imodels, but not necessarily just them) in a property grid. The property grid takes the properties through a IPropertyDataProvider interface. I believe the best approach would be to provide a function like createMergedPropertyDataProvider(providers: IPropertyDataProvider[]): MergingPropertyDataProvider. The merged provider should:
Trigger onDataChanged event whenever any of the merged providers do that.
Merge PropertyData objects from every provider into a single one. I imagine this may cause duplicate properties - that's okay, let's leave it up to consumers to ensure that there are no duplicates, either by nesting their property data under special categories or ensuring property labels are unique.
Provide ability to find the source provider, given a PropertyRecord - for editing cases we'll need to know where the property came from.
There's a use case for showing properties of multiple data sources (imodels, but not necessarily just them) in a property grid. The property grid takes the properties through a
IPropertyDataProvider
interface. I believe the best approach would be to provide a function likecreateMergedPropertyDataProvider(providers: IPropertyDataProvider[]): MergingPropertyDataProvider
. The merged provider should:onDataChanged
event whenever any of the merged providers do that.PropertyData
objects from every provider into a single one. I imagine this may cause duplicate properties - that's okay, let's leave it up to consumers to ensure that there are no duplicates, either by nesting their property data under special categories or ensuring property labels are unique.PropertyRecord
- for editing cases we'll need to know where the property came from.