Hi,
I've created Custom factory(like in tutorial) for my propertyGrid and it's working good:
protected override IList<IPropertyDataAccessor> GetProperties(object value, DataFactoryOptions options)
{
IList<IPropertyDataAccessor> dataAccessors;
var room = value as CustomDocumentWindowViewModel;
if (room != null)
{
// Create a list of property data accessor results
dataAccessors = new List<IPropertyDataAccessor>();
// Add room name
dataAccessors.Add(new CustomPropertyDataAccessor<CustomDocumentWindowViewModel, string>(room, o => o.Title, (string)Application.Current.Resources["TabName"], null));
// Add room image path
dataAccessors.Add(new CustomPropertyDataAccessor<CustomDocumentWindowViewModel, string>(room, o => o.ImagePath, (string)Application.Current.Resources["ImagePath"], null));
}
else
{
// Fall back to using the base method's results for nested objects
dataAccessors = base.GetProperties(value, options);
}
return dataAccessors;
}
But also I would like to set Category and Description for each property. Setting via attribute [Category("")] is not working. I am not sure how should I do that. Can you please explain, what should I do or give me a link, where I can see some example.
Thanks you.