Merge pull request #857 from ChoKaPeek/master

PropertyGrid: simple handling of custom editors
This commit is contained in:
NaBian 2021-06-08 20:51:35 +08:00 committed by GitHub
commit 1028f08f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
{