This project has moved. For the latest updates, please go here.

PropertyName in Xceed.Wpf.Toolkit.PropertyGrid.PropertyItem

Dec 26, 2014 at 2:46 PM
Please, append property PropertyName in the class PropertyItem.

I'm need this property in the ResolveEditor metod of my CustomEditor (inherited from ITypeEditor) for reading advanced custom attributes.
public FrameworkElement ResolveEditor(PropertyItem propertyItem)
{
  Type valueType = propertyItem.Instance.GetType();
  System.Reflection.PropertyInfo prop = valueType.GetProperty(propertyItem.PropertyName);
  MyCustomAttribute attr = Attribute.GetCustomAttribute(prop, typeof(MyCustomAttribute)) as MyCustomAttribute;
   ...
}
Developer
Jan 5, 2015 at 7:26 PM
Hi,

You can use propertyItem.DisplayName.
Jan 5, 2015 at 7:38 PM
Hi,

No, I can't use DisplayName in this:
System.Reflection.PropertyInfo prop = valueType.GetProperty(propertyItem.PropertyName);
because my property has a DisplayNameAttribute, that not equals PropertyName.
Developer
Jan 6, 2015 at 1:23 PM