I have an IEnumerable
containing IPerson
's.
These IPerson
end up as different interfaces. Some of the persons, will have a property called DirectReports
but some will not have this property. Only IManager
will.
I bind a list of direct reports, to the person, if he has the property. BUT, if he doesn't have the property (as in, the property doesn't exist on this interface, not just that it is set to false or null), I want the list to be collapsed.
So, I simply make a converter, that turns null into Visibility.Collapsed. However, this doesn't work. In debug, it turns out, that if the property doesn't exist on the interface, it doesn't even call the converter.
Is there another trick to this? Basically, I want to say, 'If the interface is missing this property, collapse that control.'