Hi,
I am trying to bind the PropertyGrid to a basic ICustomTypeDescriptor object, which wraps selected properties on another bigger class. I defined a
CustomTypeDescriptor
class but when it is assigned to SelectedObject of the PropertyGrid, the latter is not populated. All selected properties of the bigger class are marked with [Browsable(true)]
I use the following code for the GetProperties(Attribute[] attributes) overload:
...
public BiggerObject Target=new BiggerObject();
...
public PropertyDescriptorCollection GetProperties()
{
PropertyDescriptorCollection T = TypeDescriptor.GetProperties(Target, new Attribute[1] { new BrowsableAttribute(true) });
return T;
}
and can see that T is populated with properties of the Target object. However, after that the PropertyGrid appears completely empty.
May be missing something? The same approach seems working fine with the standard WPF propertygrid. I am attaching here a minimalistic VS solution demonstrating the issue.
Thank you in advance!
Attachment:
PropertyGrid_Example_807e667e.zip