Esempio n. 1
0
 public ConnectorViewModel(Connector connector)
     : base(connector)
 {
     InvolvedRelationship.Parent.SubscribeTo("X", Update);
     InvolvedRelationship.Parent.SubscribeTo("Y", Update);
     InvolvedRelationship.Parent.SubscribeTo("Content", Update);
     InvolvedRelationship.Child.SubscribeTo("X", Update);
     InvolvedRelationship.Child.SubscribeTo("Y", Update);
     InvolvedRelationship.Child.SubscribeTo("Content", Update);
     InvolvedRelationship.SubscribeTo("ChildAnchor", Update);
     InvolvedRelationship.SubscribeTo("ParentAnchor", Update);
 }
 public MindmapEditPageViewModel()
 {
     var n1 = new Node {Content = "hello", X = 50, Y = 50};
     var n2 = new Node {Content = "akash", X = 100, Y = 50};
     var c1 = new Connector();
     c1.InvolvedRelationship = new NodeRelationship
     {
         Parent = n1,
         Child = n2,
         ChildAnchor = AnchorPoint.Left,
         ParentAnchor = AnchorPoint.Right,
         Connector = c1
     };
     n1.Relationships.Add(c1.InvolvedRelationship);
     n2.Relationships.Add(c1.InvolvedRelationship);
     var m = new Mindmap {MainNode = n1};
     Mindmap = new MindmapViewModel(m);
     m.Elements.Add(n1);
     m.Elements.Add(n2);
     m.Elements.Add(c1);
 }