This project has moved and is read-only. For the latest updates, please go here.

PropertyName in Xceed.Wpf.Toolkit.PropertyGrid.PropertyItem

Dec 26, 2014 at 3: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;
   ...
}
Jan 5, 2015 at 8:26 PM
Hi,

You can use propertyItem.DisplayName.
Jan 5, 2015 at 8: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.
Jan 6, 2015 at 2:23 PM