/// <summary> /// Gets all the <see cref="ElementViewModel"/> instances that are directly contained in this <see cref="ElementViewModel"/> instance. /// </summary> /// <returns> /// </returns> protected override IEnumerable <ElementViewModel> GetAllChildElements() { var leaf = base.GetAllChildElements(); var contained = thisElementCollection .OfType <ConfigurationElement>() .Select(x => new { Browasble = TypeDescriptor.GetAttributes(x).OfType <BrowsableAttribute>().FirstOrDefault(), Instance = x }) .Where(x => x.Browasble == null || x.Browasble.Browsable) .Select(x => ContainingSection.CreateCollectionElement(this, x.Instance)) .Cast <ElementViewModel>(); return(leaf.Union(contained)); }