I saw that you create a dynamic object that wraps the items in the IEnumerable I supply.
None of the attributes is being passed to the dynamic object. As a result, the PropertyDefinition EditorAttribute is null, and if I look at PropertyDefinition.SourceProperty, then it has no attributes.
Let me start by explaining why these attributes are important in my case:
Due to compatibility, and for ease of development, I use the Browsable attribute in order to filter properties that we don't want (In that case, I filter out, in the AutoGeneratingPropertyDefinitions event, properties with either Browsable = false, or properties without the browsable property. With such way, I don't care if a property was added to the ViewModel. Instead of setting Browsable=False to lots of lots of properties, I only add True to those I want to show).
Another useful scenario:
On some properties, I want to put a slider (bound to an int), and I want to be able to control the Minimum, and the Maximum of the slider.
Currently, this is not possible using the EditorAttribute.
I've added a new custom attribute called PropertyValueAttribute, which gets a string of the property name, and the value (object), and on the FieldLoaded event, I use reflection in order to set the required properties into the actual editor.
These are just small examples of how the attributes can be used in these cases.
However, none of these attributes is being copied into the dynamic object, and furthermore, the editor itself is not being set (so I'm seeing the default editor supplied by you, if any...)
This surely looks like a bug.
Furthermore, is there any way of getting the instance of the dynamic object? (the Item property returns the IEnumerable, and if I want to do some biding to the dynamic object, then I can't).
Another question:
If I decide to work in Unbound mode, then I need to create my own PropertyDefinition, but I cannot supply the EditorAttribute to it (since this property is internal/private).
I don't want to use EditorTemplate, since I already have the attribute in ViewModel and it contains the type of the editor and the name of the property in the control that is bound to the actual property in the view model.
Why is this EditorAttribute property inaccessible? (is there any good reason?)
Thanks