
When properties change, I need to pass the property's PropertyDescriptor to another method.
When properties that are not collections change, I am using the PropertyChanged event to detect the change and then, to get the PropertyDescriptor of the property, I cast the IPropertyDataAccessor to a PropertyDescriptorDataAccessor and then I am able to access its PropertyDescriptor.
When it comes to properties that are collections, I use the PropertyChildAdded and PropertyChildRemoved events and cast the IPropertyDataAccessor to a CollectionPropertyDescriptorDataAccessor. This gives me access to the PropertyDescriptor of the collection and so, for collections, that covers adding and removing an item to a collection.
But when an item in a collection changes, the only event that I can see to use is the above mentioned PropertyChanged event. When this fires, the IPropertyDataAccessor corresponds to the item that was changed in the collection. So I thought I would take the Parent of the IPropertyDataAccessor to find the collection and get its PropertyDescriptor, but I can't seem to do this as it doesn't cast to a PropertyDescriptorDataAccessor.
How, when an item in a collection changes, am I able to get to the property of the collection it is a part of so I can get the PropertyDescriptor of that collection?