Exemple #1
0
        public ToolboxItemViewModel(VisualProgramViewModel parent, Type type) : base(type)
        {
            this.parent = parent;

            // Create a collection with as many types as there are generic arguments in the target IVisualNode type
            for (var i = 0; i < type.GetGenericArguments().Length; i++)
            {
                selectedGenericTypes.Add(typeof(string));
                SelectedGenericTypesViewModels.Add(new ToolboxItemGenericArgumentViewModel(this, i));
            }
            selectedGenericTypes.CollectionChanged += (sender, e) => Notify(nameof(TemplateInstance));

            // TODO: Add support for restricting allowed generic types based on attributes or type constraints
        }
 internal ToolboxEntryViewModel(VisualProgramViewModel parent, EntryDefinition model) : base(model)
 {
     this.parent             = parent;
     parent.PropertyChanged += Parent_PropertyChanged;
 }