internal FrameworkElement GenerateChildrenEditorElement(PropertyItem propertyItem)
        {
            FrameworkElement editorElement      = null;
            DescriptorPropertyDefinitionBase pd = propertyItem.DescriptorDefinition;
            object      definitionKey           = null;
            Type        definitionKeyAsType     = definitionKey as Type;
            ITypeEditor editor = null;

            if (editor == null)
            {
                editor = pd.CreateAttributeEditor();
            }

            if (editor != null)
            {
                editorElement = editor.ResolveEditor(propertyItem);
            }


            if (editorElement == null && definitionKey == null)
            {
                editorElement = this.GenerateCustomEditingElement(propertyItem.PropertyDescriptor.Name, propertyItem);
            }

            if (editorElement == null && definitionKeyAsType == null)
            {
                editorElement = this.GenerateCustomEditingElement(propertyItem.PropertyType, propertyItem);
            }

            if (editorElement == null)
            {
                if (pd.IsReadOnly)
                {
                    editor = new TextBlockEditor();
                }

                // Fallback: Use a default type editor.
                if (editor == null)
                {
                    editor = (definitionKeyAsType != null)
          ? PropertyGridUtilities.CreateDefaultEditor(definitionKeyAsType, null)
          : pd.CreateDefaultEditor();
                }

                Debug.Assert(editor != null);

                editorElement = editor.ResolveEditor(propertyItem);
            }

            return(editorElement);
        }
 internal override ITypeEditor CreateDefaultEditor()
 {
     return(PropertyGridUtilities.CreateDefaultEditor(PropertyDescriptor.PropertyType, PropertyDescriptor.Converter));
 }