Is there a way to aggregate properties into a PropertyGrid control, for instance from multiple simultaneous objects at once?
There are two aggregation strategies that would be useful depending on the circumstance:
- Display the union of all properties of all selected objects. (This is very useful for batch editing multiple selected objects, say in an editor.)
- Display only the properties that are common to all selected objects.
I understand there is a design barrier to this, because the property controls may need to be aware of conflicts and convey a ghost state when properties of the same name and return type have conflicting data. But the payoff is potentially huge for certain
Just in case I am missing a native approach: Is there an elegant way to achieve the same effect in C#4 (or even better 3) by exploiting dynamic objects instead of requiring special handling code in the PropertyGrid? ie. build a dynamic object on the
fly that is the aggregate of all individual object properties?