public IdentityEntityProperties(XElement parent, PropertyExtensionContext context)
 {
     this.propertyManager = new PropertyManager(parent.GetDefaultNamespace());
     this.context = context;
     this.parent = parent;
     this.parent.Changed += parentChanged;
 }
        protected override void FillTreeWithData(Selector selector, ITypeDescriptorContext context, IServiceProvider provider)
        {
            base.FillTreeWithData(selector, context, provider);

            var model = xElementProperty.GetValue(wrappedItemProperty.GetValue(context.Instance)) as XElement;

            selector.AddNode("(None)", null, null);
            var items = new PropertyManager(model.GetDefaultNamespace()).GetEntityTypes(model).Select(et => et.Attribute("Name").Value).OrderBy(n => n).ToList();
            foreach (string entityTypeName in items)
            {
                selector.AddNode(entityTypeName, entityTypeName, null);
            }

            //int nOfItems = selector.Height / selector.ItemHeight;
            selector.Height = selector.ItemHeight * Math.Min(items.Count + 1, 8);
        }