My fix for this was to add the following code to DescriptorPropertyDefinition:
public object GetValueInstance(object sourceObject)
{
ICustomTypeDescriptor customTypeDescriptor = sourceObject as ICustomTypeDescriptor;
if (customTypeDescriptor != null)
sourceObject = customTypeDescriptor.GetPropertyOwner(PropertyDescriptor);
return sourceObject;
}
Then I updated the CreateBinding() method to be: protected override BindingBase CreateValueBinding()
{
//Bind the value property with the source object.
var binding = new Binding(PropertyDescriptor.Name)
{
Source = GetValueInstance(SelectedObject),
Mode = PropertyDescriptor.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay,
ValidatesOnDataErrors = true,
ValidatesOnExceptions = true
};
return binding;
}