Пример #1
0
        public static List <DataTemplateViewModel> GetDiagramClassTemplate(DiagramClassViewModel vm)
        {
            MetaModel metaModel = vm.DiagramClassView.DiagramView.ViewContext.ModelContext.MetaModel;

            return(ParseFile(vm.ViewModelStore, "DiagramTemplate.xml",
                             new string[] {
                metaModel.Name,                                 // CustomString0
                vm.DiagramClassView.DiagramClass.Name,          // CustomString1
                metaModel.Namespace,                            // CustomString2
            }));
        }
 /// <summary>
 /// Constructor. This view model constructed with 'bHookUpEvents=true' does react on model changes.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="embeddingDiagramNode">Element represented by this view model.</param>
 public RootDiagramNodeViewModel(ViewModelStore viewModelStore, RootDiagramNode rootDiagramNode, DiagramClassViewModel parent)
     : base(viewModelStore, rootDiagramNode, null)
 {
     this.parent = parent;
 }
        public static List<DataTemplateViewModel> GetDiagramClassTemplate(DiagramClassViewModel vm)
        {
            MetaModel metaModel = vm.DiagramClassView.DiagramView.ViewContext.ModelContext.MetaModel;

            return ParseFile(vm.ViewModelStore, "DiagramTemplate.xml",
                new string[]{
                    metaModel.Name,                             // CustomString0
                    vm.DiagramClassView.DiagramClass.Name,      // CustomString1
                    metaModel.Namespace,                        // CustomString2
                });

        }
        /// <summary>
        /// Adds a new diagram class view model for the given node.
        /// </summary>
        /// <param name="node">Node.</param>
        public void AddDiagramClassView(DiagramClassView node)
        {
            // verify that node hasnt been added yet
            foreach (DiagramClassViewModel viewModel in this.rootNodeVMs)
                if (viewModel.DiagramClassView.Id == node.Id)
                    return;

            if (node.DiagramClass is SpecificDependencyDiagram)
            {
                SpecificDependencyDiagramViewModel vm = new SpecificDependencyDiagramViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
            else if (node.DiagramClass is DependencyDiagram)
            {
                DependencyDiagramViewModel vm = new DependencyDiagramViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
            else if (node.DiagramClass is ModalDiagram)
            {
                ModalDiagramViewModel vm = new ModalDiagramViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
            else if (node.DiagramClass is SpecificElementsDiagram)
            {
                SpecificElementsDiagramViewModel vm = new SpecificElementsDiagramViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
            else
            {
                DiagramClassViewModel vm = new DiagramClassViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
        }
 /// <summary>
 /// Constructor. This view model constructed with 'bHookUpEvents=true' does react on model changes.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="embeddingDiagramNode">Element represented by this view model.</param>
 public RootDiagramNodeViewModel(ViewModelStore viewModelStore, RootDiagramNode rootDiagramNode, DiagramClassViewModel parent)
     : base(viewModelStore, rootDiagramNode, null)
 {
     this.parent = parent;
 }