Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 public ElementViewModelPathBuilder(ElementViewModel parentViewModel, ElementViewModel me)
 {
     parentPath = (parentViewModel != null) ? parentViewModel.path : null;
     this.me    = me;
 }