Description
arobincaron[CodePlex]
The property grid ObjectContainerHelper class uses Type.GetCustomAttributes() to get the CategoryOrderAttribute instead of using TypeDescriptor.GetAttributes(). This is inconsistent with the way these types of attributes are retreived for the rest of property
grid and prevents adding this metadata attribute for classes that lack it.
In Xceed.Wpf.Toolkit\PropertyGrid\Implementation\ObjectContainerHelper.cs around line 109 I changed the following code:
CategoryOrderAttribute[] orderAttributes = ( selectedObject != null )
? ( CategoryOrderAttribute[] )selectedObject.GetType().GetCustomAttributes( typeof( CategoryOrderAttribute ), true )
: new CategoryOrderAttribute[ 0 ];
to
CategoryOrderAttribute[] orderAttributes = (selectedObject != null)
? TypeDescriptor.GetAttributes(selectedObject.GetType()).OfTypeltCategoryOrderAttributegt().ToArray()
: new CategoryOrderAttribute[0];