PropertyGrid: simple handling of custom editors

In PropertyResolver, CreateEditor() uses the provided type or falls back to previous behavior
This commit is contained in:
Amael TARDIF committed 2021-06-05 14:04:11 +02:00
1 parent 42b2cb3033
commit a5aedba1f2
1 file changed
+1 -1
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
? (PropertyEditorBase) new EnumPropertyEditor()
: new ReadOnlyTextPropertyEditor();
public virtual PropertyEditorBase CreateEditor(Type type) => new ReadOnlyTextPropertyEditor();
public virtual PropertyEditorBase CreateEditor(Type type) => Activator.CreateInstance(type) as PropertyEditorBase ?? new ReadOnlyTextPropertyEditor();
private enum EditorTypeCode
{