private ElementViewModel(ElementViewModel parentElementModel, ConfigurationElement thisElement, IEnumerable <Attribute> componentModelAttributes, IEnumerable <Attribute> additionalAttributes) { this.thisElement = thisElement; this.parentElementModel = parentElementModel; path = new ElementViewModelPathBuilder(parentElementModel, this); metadata = new MetadataCollection(componentModelAttributes); metadata.Override(additionalAttributes); if (parentElementModel != null) { this.parentElementModel.PropertyChanged += ParentPropertyChangedHandler; } promoteCommands = metadata.Attributes.OfType <PromoteCommandsAttribute>().Any(); configurationProperty = Attributes.OfType <ConfigurationPropertyAttribute>().FirstOrDefault(); }
public ElementViewModelPathBuilder(ElementViewModel parentViewModel, ElementViewModel me) { parentPath = (parentViewModel != null) ? parentViewModel.path : null; this.me = me; }