diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/ExpandableObjectAttribute.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/ExpandableObjectAttribute.cs new file mode 100644 index 00000000..bbf9219f --- /dev/null +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/Attributes/ExpandableObjectAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace Microsoft.Windows.Controls.PropertyGrid.Attributes +{ + public class ExpandableObjectAttribute : Attribute + { + public ExpandableObjectAttribute() + { + + } + } +} diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs index 7a7429ca..3bc621d6 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/PropertyGrid/Implementation/PropertyItem.cs @@ -8,6 +8,7 @@ using System.Windows.Data; using System.Windows.Input; using System.Windows.Markup.Primitives; using Microsoft.Windows.Controls.PropertyGrid.Commands; +using Microsoft.Windows.Controls.PropertyGrid.Attributes; namespace Microsoft.Windows.Controls.PropertyGrid { @@ -334,8 +335,8 @@ namespace Microsoft.Windows.Controls.PropertyGrid if (!IsReadOnly) { - TypeConverter converter = PropertyDescriptor.Converter; - if (converter is ExpandableObjectConverter && PropertyDescriptor.GetValue(Instance) != null) + var attribute = PropertyGridUtilities.GetAttribute(PropertyDescriptor); + if (attribute != null && PropertyDescriptor.GetValue(Instance) != null) { HasChildProperties = true; } @@ -384,12 +385,7 @@ namespace Microsoft.Windows.Controls.PropertyGrid private void GetChildProperties() { - TypeConverter converter = PropertyDescriptor.Converter; - - PropertyDescriptorCollection descriptors = null; - - if (converter is ExpandableObjectConverter) - descriptors = PropertyDescriptor.GetChildProperties(); + PropertyDescriptorCollection descriptors = PropertyDescriptor.GetChildProperties(); var propertyItems = new List(); diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj index d7f60f2d..862120a9 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj @@ -237,6 +237,7 @@ True +