diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/TypeEditorAttribute.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/TypeEditorAttribute.cs deleted file mode 100644 index 26bbd28f..00000000 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/TypeEditorAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace Microsoft.Windows.Controls.PropertyGrid.Attributes -{ - public class TypeEditorAttribute : Attribute - { - public Type Type { get; set; } - - public TypeEditorAttribute(Type type) - { - var valueSourceInterface = type.GetInterface("Microsoft.Windows.Controls.PropertyGrid.Editors.ITypeEditor"); - if (valueSourceInterface == null) - throw new ArgumentException("Type must implement the ITypeEditor interface.", "type"); - - Type = type; - } - } -} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs index 8b0c90b7..b0869610 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyGrid.cs @@ -407,7 +407,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid }; propertyItem.SetBinding(PropertyItem.ValueProperty, binding); - propertyItem.Editor = GetTypeEditor(propertyItem); + propertyItem.Editor = GetTypeEditor(propertyItem); return propertyItem; } @@ -436,11 +436,13 @@ namespace Microsoft.Windows.Controls.PropertyGrid if (itemsSourceAttribute != null) editor = new ItemsSourceEditor(itemsSourceAttribute).ResolveEditor(propertyItem); - var editorAttribute = GetAttribute(propertyItem.PropertyDescriptor); + var editorAttribute = GetAttribute(propertyItem.PropertyDescriptor); if (editorAttribute != null) { - var instance = Activator.CreateInstance(editorAttribute.Type); - editor = (instance as ITypeEditor).ResolveEditor(propertyItem); + Type type = Type.GetType(editorAttribute.EditorTypeName); + var instance = Activator.CreateInstance(type); + if (instance is ITypeEditor) + editor = (instance as ITypeEditor).ResolveEditor(propertyItem); } return editor; diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj index 81859f16..282f6c85 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj @@ -237,7 +237,6 @@ True -